[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7841":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":33,"discoverSource":34},7841,"rubycritic","whitesmith\u002Frubycritic","whitesmith","A Ruby code quality reporter","",null,"Ruby",3494,234,44,32,0,2,5,1,60.61,"MIT License",false,"main",[25,26,27,28,29],"best-practices","metrics","quality-reporter","ruby","static-analysis","2026-06-12 04:00:36","# RubyCritic\n\n[![Gem Version](https:\u002F\u002Fbadge.fury.io\u002Frb\u002Frubycritic.svg)](http:\u002F\u002Fbadge.fury.io\u002Frb\u002Frubycritic)\n[![Continuous Integration](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Factions\u002Fworkflows\u002Fmain.yml\u002Fbadge.svg?branch=main)](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Factions\u002Fworkflows\u002Fmain.yml)\n[![Code Climate](https:\u002F\u002Fcodeclimate.com\u002Fgithub\u002Fwhitesmith\u002Frubycritic\u002Fbadges\u002Fgpa.svg)](https:\u002F\u002Fcodeclimate.com\u002Fgithub\u002Fwhitesmith\u002Frubycritic)\n\n\u003Cimg src=\"https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fraw\u002Fmain\u002Fimages\u002Flogo.png\" alt=\"RubyCritic Icon\" align=\"right\">\n\nRubyCritic is a gem that wraps around static analysis gems such as [Reek][1], [Flay][2] and [Flog][3] to provide a quality report of your Ruby code.\n\n## Table of Contents\n\n- [RubyCritic](#rubycritic)\n   - [Table of Contents](#table-of-contents)\n   - [Overview](#overview)\n   - [Getting Started](#getting-started)\n   - [Usage](#usage)\n      - [Analyzer Configuration](#analyzer-configuration)\n      - [Alternative Usage Methods](#alternative-usage-methods)\n      - [Rake Task](#rake-task)\n   - [Formatters](#formatters)\n   - [Compatibility](#compatibility)\n   - [Improving RubyCritic](#improving-rubycritic)\n   - [Contributors](#contributors)\n   - [Credits](#credits)\n\n## Overview\n\nThis gem provides features such as:\n\n1. An overview of your project:\n  ![RubyCritic overview screenshot](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fraw\u002Fmain\u002Fimages\u002Foverview.png)\n\n2. An index of the project files with their respective number of smells:\n  ![RubyCritic code index screenshot](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fraw\u002Fmain\u002Fimages\u002Fcode.png)\n\n3. An index of the smells detected:\n  ![RubyCritic smells index screenshot](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fraw\u002Fmain\u002Fimages\u002Fsmells.png)\n\n4. When analysing code like the following:\n\n  ```ruby\n  class Dirty\n    def awful(x, y)\n      if y\n        @screen = widgets.map {|w| w.each {|key| key += 3}}\n      end\n    end\n  end\n  ```\n\n  It basically turns something like this:\n\n  ![Reek output screenshot](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fraw\u002Fmain\u002Fimages\u002Freek.png)\n\n  Into something like this:\n\n  ![RubyCritic file code screenshot](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fraw\u002Fmain\u002Fimages\u002Fsmell-details.png)\n\n5. It uses your source control system (only Git, Mercurial and Perforce\n  are currently supported) to compare your currently uncommitted\n  changes with your last commit.\n\n    **Warning**: If your code is not as you expect it to be after running\n    RubyCritic, please check your source control system stash.\n\nCheckout the `\u002Fdocs` if you want to read more about our [core metrics](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fblob\u002Fmain\u002Fdocs\u002Fcore-metrics.md).\n\n## Getting Started\n\nRubyCritic can be installed with the following command:\n\n```bash\n$ gem install rubycritic\n```\n\nIf you'd rather install RubyCritic using Bundler, add this line to your\napplication's Gemfile:\n\n```ruby\ngem \"rubycritic\", require: false\n```\n\nAnd then execute:\n\n```bash\n$ bundle\n```\n\n## Usage\n\nRunning `rubycritic` with no arguments will analyse all the Ruby files in the\ncurrent directory:\n\n```bash\n$ rubycritic\n```\n\nAlternatively you can pass `rubycritic` a list of files and directories.\nThe analysis will be scoped to the provided files and directories:\n\n```bash\n$ rubycritic app lib\u002Ffoo.rb\n```\n\nFor a full list of the command-line options run:\n\n```bash\n$ rubycritic --help\n```\n\n| Command flag                     | Description                                                     |\n|----------------------------------|-----------------------------------------------------------------|\n| `-v` \u002F `--version`               | Displays the current version and exits                          |\n| `-p` \u002F `--path`                  | Set path where report will be saved (tmp\u002Frubycritic by default) |\n| `--coverage-path`                | Set path where SimpleCov will be saved (.\u002Fcoverage by default)  |\n| `-f` \u002F `--format`                | Report smells in the given format(s)\u003Csup>1\u003C\u002Fsup>                |\n| `--custom-format path:classname` | Load and instantiate custom formatter(s)\u003Csup>2\u003C\u002Fsup>            |\n| `-s` \u002F `--minimum-score`         | Set a minimum score (FLOAT: ex: 96.28), default: 0              |\n| `-m` \u002F `--mode-ci`               | Use CI mode\u003Csup>3\u003C\u002Fsup>                                         |\n| `-b` \u002F `--branch`                | Set branch to compare                                           |\n| `-t` \u002F `--maximum-decrease`      | Threshold for score difference between two branches\u003Csup>4\u003C\u002Fsup> |\n| `--deduplicate-symlinks`         | De-duplicate symlinks based on their final target               |\n| `--suppress-ratings`             | Suppress letter ratings                                         |\n| `--no-browser`                   | Do not open html report with browser                            |\n\n1. Available output formats:\n- `html` (default; will open in a browser)\n- `json`\n- `console`\n- `lint`\n2. See [custom formatters docs](\u002Fdocs\u002Fformatters.md)\n3. Faster, analyses diffs w.r.t base_branch (default: main), see `-b`\n4. Works only with `-b`, default: 0\n\nYou also can use a config file. Just create a `.rubycritic.yml` on your project root path.\n\nHere are one example:\n\n```yml\nmode_ci:\n  enabled: true # default is false\n  branch: 'production' # default is main\nbranch: 'production' # default is main\npath: '\u002Ftmp\u002Fmycustompath' # Set path where report will be saved (tmp\u002Frubycritic by default)\ncoverage_path: '\u002Ftmp\u002Fcoverage' # Set path where SimpleCov coverage will be saved (.\u002Fcoverage by default)\nthreshold_score: 10 # default is 0\ndeduplicate_symlinks: true # default is false\nsuppress_ratings: true # default is false\nno_browser: true # default is false\nformats: # Available values are: html, json, console, lint. Default value is html.\n  - console\nminimum_score: 95 # default is 0\npaths: # Files to analyse. Churn calculation is scoped to these files when using Git SCM.\n  - 'app\u002Fcontrollers\u002F'\n  - 'app\u002Fmodels\u002F'\n  - 'lib\u002F**'  # Wildcard patterns are supported (excludes tmp directories automatically)\n```\n\n### Analyzer Configuration\n\n* [`Reek`](https:\u002F\u002Fgithub.com\u002Ftroessner\u002Freek): `RubyCritic` utilizes `Reek`'s default [configuration loading mechanism](https:\u002F\u002Fgithub.com\u002Ftroessner\u002Freek#configuration-file).\n  This means that if you have an existing `Reek` configuration file, you can just put this into your\n  project root and `RubyCritic` will respect this configuration.\n* [`flay`](https:\u002F\u002Fgithub.com\u002Fseattlerb\u002Fflay): We use `flay`'s default configuration.\n* [`flog`](https:\u002F\u002Fgithub.com\u002Fseattlerb\u002Fflog): We use `flog`'s default configuration with a couple of [smaller tweaks](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fblob\u002Fmain\u002Flib\u002Frubycritic\u002Fanalysers\u002Fhelpers\u002Fflog.rb#L5):\n   * `all`: Forces `flog` to report scores on all classes and methods. Without this option `flog` will only give results up to a certain threshold.\n   * `continue`: Makes it so that `flog` does not abort when a ruby file cannot be parsed.\n   * `methods`: Configures `flog` to skip code outside of methods. It prevents `flog` from reporting on the \"methods\" `private` and `protected`. It also prevents `flog` from reporting on Rails methods like `before_action` and `has_many`.\n\n### Alternative Usage Methods\n\nIf you're fond of Guard you might like [guard-rubycritic][4]. It automatically analyses your Ruby files as they are modified.\n\nFor continuous integration, you can give [Jenkins CI][5] a spin. With it, you can [easily build your own (poor-man's) Code Climate][6]!\n\n### Rake Task\n\nYou can use RubyCritic as Rake command in its most simple form like this:\n\n```ruby\nrequire \"rubycritic\u002Frake_task\"\n\nRubyCritic::RakeTask.new\n```\n\nA more sophisticated Rake task that would make use of all available configuration options could look like this:\n\n```ruby\nRubyCritic::RakeTask.new do |task|\n  # Name of RubyCritic task. Defaults to :rubycritic.\n  task.name    = 'something_special'\n\n  # Glob pattern to match source files. Defaults to FileList['.'].\n  task.paths   = FileList['vendor\u002F**\u002F*.rb']\n\n  # You can pass all the options here in that are shown by \"rubycritic -h\" except for\n  # \"-p \u002F --path\" since that is set separately. Defaults to ''.\n  task.options = '--mode-ci --format json'\n\n  # Defaults to false\n  task.verbose = true\n\n  # Fail the Rake task if RubyCritic doesn't pass. Defaults to true\n  task.fail_on_error = true\nend\n```\n\nRubyCritic will try to open the generated report with a browser by default. If you don't want this\nyou can prevent this behaviour by setting the options correspondingly:\n\n```ruby\nRubyCritic::RakeTask.new do |task|\n  task.options = '--no-browser'\nend\n```\n\nIf you wish to create multiple Rake tasks (e.g., for local & for ci-specific configuration), you can do so!\nIf you decide to do this, you should provide a clearer description for each task:\n\n```ruby\n# for local\nRubyCritic::RakeTask.new(\"local\", \"Run RubyCritic (local configuration)\" do |task|\n  # ...\nend\n\n# for CI\nRubyCritic::RakeTask.new(\"ci\", \"Run RubyCritic (CI configuration)\" do |task|\n  task.options = \"--mode-ci\"\n  # ...\nend\n```\n\n## Formatters\n\nSee [formatters](docs\u002Fformatters.md)\n\n## Compatibility\n\nRubyCritic is supporting Ruby versions:\n\n| Ruby version | Latest RubyCritic version |\n| --- | --- |\n| 2.4 | [v4.7.0](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Ftree\u002Fv4.7.0) |\n| 2.5 | [v4.7.0](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Ftree\u002Fv4.7.0) |\n| 2.6 | [v4.7.0](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Ftree\u002Fv4.7.0) |\n| 2.7 | [v4.9.1](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Ftree\u002Fv4.9.1) |\n| 3.0 | [v4.9.2](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Ftree\u002Fv4.9.1) |\n| 3.1 | [v4.12.0](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Ftree\u002Fv4.12.0) |\n| 3.2 | latest |\n| 3.3 | latest |\n| 3.4 | latest |\n| 4.0 | latest |\n\n## Improving RubyCritic\n\nRubyCritic doesn't have to remain a second choice to other code quality analysis services. Together, we can improve it and continue to build on the great code metric tools that are available in the Ruby ecosystem.\n\nArguably, the [better_errors gem][7] only got popular after receiving a [(pretty awesome) Pull Request][8] that changed its page design.\n\nSimilarly, Pull Requests that improve the look and feel of the gem, that tweak the calculation of ratings or that fix existing issues will be most welcome. Just commenting on an issue and giving some insight into how something should work will be appreciated. No contribution is too small.\n\nSee RubyCritic's [contributing guidelines](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fblob\u002Fmain\u002FCONTRIBUTING.md) about how to proceed.\n\n## Contributors\n\n`RubyCritics` initial author was [Guilherme Simões](https:\u002F\u002Fgithub.com\u002Fguilhermesimoes).\n\nThe current core team consists of:\n\n* [Nuno Silva](https:\u002F\u002Fgithub.com\u002Fnunosilva800)\n* [Lucas Mazza](https:\u002F\u002Fgithub.com\u002Flucasmazza)\n* [Timo Rößner](https:\u002F\u002Fgithub.com\u002Ftroessner)\n\n## Credits\n\n![Whitesmith](https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fraw\u002Fmain\u002Fimages\u002Fwhitesmith.png)\n\nRubyCritic is maintained and funded by [Whitesmith][9]. Tweet your questions or suggestions to [@Whitesmithco][10].\n\n[1]: https:\u002F\u002Fgithub.com\u002Ftroessner\u002Freek\n[2]: https:\u002F\u002Fgithub.com\u002Fseattlerb\u002Fflay\n[3]: https:\u002F\u002Fgithub.com\u002Fseattlerb\u002Fflog\n[4]: https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Fguard-rubycritic\n[5]: http:\u002F\u002Fjenkins-ci.org\u002F\n[6]: https:\u002F\u002Fgithub.com\u002Fwhitesmith\u002Frubycritic\u002Fblob\u002Fmain\u002Fdocs\u002Fbuilding-own-code-climate.md\n[7]: https:\u002F\u002Fgithub.com\u002Fcharliesome\u002Fbetter_errors\n[8]: https:\u002F\u002Fgithub.com\u002Fcharliesome\u002Fbetter_errors\u002Fpull\u002F22\n[9]: http:\u002F\u002Fwww.whitesmith.co\u002F\n[10]: https:\u002F\u002Ftwitter.com\u002FWhitesmithco\n","RubyCritic 是一个 Ruby 代码质量报告工具，它集成了 Reek、Flay 和 Flog 等静态分析工具来提供全面的代码质量评估。核心功能包括生成项目概览、列出文件及其代码异味数量、详细展示检测到的异味，并支持与版本控制系统（如 Git、Mercurial 和 Perforce）集成以比较未提交更改和最近一次提交之间的差异。技术特点在于其能够将复杂的静态分析结果转化为易于理解的可视化报告。适用于需要持续改进代码质量和遵循最佳实践的 Ruby 项目开发场景。","2026-06-11 03:14:41","top_language"]