{"id":20032829,"url":"https://github.com/dogweather/ruby-quality-report","last_synced_at":"2025-11-11T19:27:50.871Z","repository":{"id":261715250,"uuid":"885121155","full_name":"dogweather/ruby-quality-report","owner":"dogweather","description":"Comparative metrics for all contributors to a repo.","archived":false,"fork":false,"pushed_at":"2024-11-29T19:08:51.000Z","size":492,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-11T06:21:08.097Z","etag":null,"topics":["git","metrics","quality","ruby","software-engineering"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dogweather.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-08T01:53:53.000Z","updated_at":"2024-11-29T19:26:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb05cdae-c4ec-4efb-a1aa-ca47d4d59f35","html_url":"https://github.com/dogweather/ruby-quality-report","commit_stats":null,"previous_names":["dogweather/ruby-quality-report"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/dogweather/ruby-quality-report","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogweather%2Fruby-quality-report","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogweather%2Fruby-quality-report/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogweather%2Fruby-quality-report/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogweather%2Fruby-quality-report/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dogweather","download_url":"https://codeload.github.com/dogweather/ruby-quality-report/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dogweather%2Fruby-quality-report/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275649813,"owners_count":25503212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","metrics","quality","ruby","software-engineering"],"created_at":"2024-11-13T09:43:22.282Z","updated_at":"2025-09-17T19:30:57.431Z","avatar_url":"https://github.com/dogweather.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ruby Quality Report\n\n## Installation\n\n```sh\ngem install quality_report\n```\n\n## Usage\n\nChange to a project directory that contains `*.rb` files. Then:\n\n```sh\nruby-quality-report\n```\n\nAfter a bit of a wait, it prints a table to stdout:\n\n![Screenshot](quality-report-screenshot-2@2x.webp)\n\nThis is showing, for each contributor, the percentage of problematic lines of code in the repo. Lower is better.\nI added the **Status** column data manually using the `--add-column` option:\n\n```\nOptions:\n  -c, --add-column JSON  Add a static column to the report. This is a simple\n                         way to add known information. See the examples.\n  -h, --help             Print this help\n  -s, --skip AUTHOR      Filter out a git author\n\nExamples:\n  Append a column showing office location. The order of the keys in the JSON\n  does not matter:\n    $ ruby-quality-report -c '{\"Location\": {\"Amy\": \"NYC\", \"Bob\": \"Remote\"}}'\n\n  Skip one author:\n    $ ruby-quality-report --skip Cathy\n```\n\n### In Rails Projects\n\nIt works great in Rails projects. It examines code recursively starting in the current directory. In my testing,\nI like the results best when run from `/app`. This is how I generated the report, above.\n\n## Inspiration \u0026 Intent\n\nI had a hunch that this was happening on a project I'm familiar with:\n\n![Dilbert Strip: Bug Bonus](dilbert-bug-bounty.jpeg)\n\nSo I wrote this gem. As it turned out, there _was_ a measurable difference between staff and the consultants.\n\n### I'm now using this as a management tool to:\n\n- understand the quality of the code a team is producing,\n- identify programmers who'd benefit from mentorship and education,\n- reveal differences between different developer groups.\n\n\n## How it works\n\n### 1. Analyze the Code\n\nIt runs a subset of [Rubocop Metrics cops](https://docs.rubocop.org/rubocop/cops_metrics.html) on `*.rb` files that flag single lines or methods:\n\n- [ABC Size](https://docs.rubocop.org/rubocop/cops_metrics.html#metricsabcsize)\n- [Block Length](https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocklength)\n- [Block Nesting](https://docs.rubocop.org/rubocop/cops_metrics.html#metricsblocknesting)\n- [Cyclomatic Complexity](https://docs.rubocop.org/rubocop/cops_metrics.html#metricscyclomaticcomplexity)\n- [Method Length](https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmethodlength)\n- [Perceived Complexity](https://docs.rubocop.org/rubocop/cops_metrics.html#metricsperceivedcomplexity)\n\n\nHere's a great video that illustrates the problems these metrics are designed to catch:\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://youtu.be/-AzSRHiV9Cc?si=-mcb3A94KnGOvth\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/2d835137-1d55-42ba-abd0-64c09cd6fe0f\"\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n### 2. Calculate Stats\n\nUsing git, it calculates the percentage of warnings per line written, per author. Each failing check is another warning.\n\n\n### For improved relevance, it has two filters.\n\nIt excludes:\n\n- authors with fewer than 200 lines of code\n- authors with no commits in the previous 60 days\n\n\n## Foundational Research\n\nDiving a little deeper, I've seen the phenomenon of \"micro-economies\" of bug-creation and bug-fixing develop within teams. Some developers appear to be extremely productive. They create a lot of commits. But they also create a lot of bugs. Their productivity is illusory.\n\nThis code quality report doesn't track **bugs** per se. But it does report **quality and complexity**. Researchers have found a strong correlation between complexity and bug rate [1]. This link is reflected, _e.g.,_ in international safety standards that mandate low software complexity to reduce failures [2].\n\nComplex code introduces bugs in a second, more subtle way. This is because code complexity is the killer of understandability. Studies have found that developers devote 64% of their time to understanding code, while only 5% is spent on actually modifying it [3].\n\n1. De Silva, Dilshan, et al. The Relationship between Code Complexity and Software Quality: An Empirical Study. 2023, https://www.researchgate.net/publication/370761578_The_Relationship_between_Code_Complexity_and_Software_Quality_An_Empirical_Study.\n2.  See e.g., ISO 26262-1:2018(En), Road Vehicles — Functional Safety — Part 1: Vocabulary. https://www.iso.org/obp/ui/en/#iso:std:iso:26262:-1:ed-2:v1:en. Accessed 29 Sept. 2024.\n3.  Feitelson, Dror G. “From Code Complexity Metrics to Program Comprehension.” Communications of the ACM, vol. 66, no. 5, May 2023, pp. 52–61. DOI.org (Crossref), https://doi.org/10.1145/3546576.\n\n\n## Roadmap\n\n- [x] Colorize the output to separate high, medium, and low warning percentages.\n- [x] Fix the numerical alignment.\n- [x] --add-column option.\n- [x] --skip option.\n- [ ] Add a progress bar.\n- [ ] Speed up the scan.\n- [ ] Refactor from script-style coding to a more standard Ruby project.\n- [ ] Make the filters configurable.\n- [ ] Add a `--csv` option.\n- [ ] Try using the git `email` attribute to automatically determine if an author is a team member or external.\n\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/dogweather/ruby-quality-report.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogweather%2Fruby-quality-report","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdogweather%2Fruby-quality-report","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdogweather%2Fruby-quality-report/lists"}