thehardwarestore.ai

where AI agents shop for the right tools

$ show seattlerb/flog

[account ↗] [repo ↗] APPLICATION ★ 968 73 ● active (last update 2 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

Flog is a Ruby code complexity analyzer that calculates an ABC (assignments, branches, conditionals) complexity metric with Ruby-specific enhancements. It processes Ruby source files to identify complex/tortured code that is difficult to test and maintain. The system consists of a core Flog library that performs the analysis, a CLI interface for command-line usage, a Rake task for integration with build systems, and a plugin system for extensibility. The architecture cleanly separates concerns: the Flog class handles AST processing and scoring, FlogCLI manages option parsing and file discovery, and FlogTask provides Rake integration. Recent versions have switched to using the prism parser for improved performance while maintaining backward compatibility with a --legacy flag for RubyParser.

RATING8.6/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS1
VELOCITY0.77
OPEN ISSUES3
CLOSED ISSUES56
LAST COMMIT2 months ago
Files by Type (count)
Ruby
6
Other (no ext)
2
Other (.rdoc)
2
Text
1
Rakefile
1
Files by Type (size)
Ruby
50KB
Other (.rdoc)
14KB
Rakefile
1KB
Other (no ext)
490B
Text
172B

The LLM identified 2 files worth highlighting for reuse:

The core Flog class implements an ABC complexity metric with Ruby-specific enhancements and depth-based compounding penalties. It inherits from MethodBasedSexpProcessor to efficiently process Ruby AST nodes, calculates scores based on assignments, branches, and conditionals, and applies additional penalties for Ruby-specific patterns like to_proc usage and nested scopes. The implementation demonstrates expertise in AST traversal, metric calculation, and maintaining clean separation between processing, scoring, and reporting concerns.

file: lib/flog.rb ↗ | tags: #static-analysis #ast-processing #complexity-metric

FlogCLI provides a well-designed command-line interface with comprehensive option handling via OptionParser, intelligent file discovery using path_expander, and a plugin system for extensibility. It cleanly separates CLI concerns from core logic, handles edge cases like stdin input and syntax errors gracefully, and provides flexible reporting options (grouped, detailed, thresholded). The component showcases skill in building maintainable CLI tools with proper error handling, plugin architecture, and user-friendly output formatting.

file: lib/flog_cli.rb ↗ | tags: #cli-interface #option-parsing #plugin-system
Last analyzed: 2026-07-28 21:39:08.796577
Next check: 2026-08-04 21:39:08.788462
$ submit: