quality_report 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +10 -8
- data/exe/ruby-quality-report +18 -5
- data/lib/quality_report/version.rb +1 -1
- data/screenshot-1@2x.webp +0 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23d2fbfb3f81887e40858181c9822346e770e8f242d96cfb39b8239b5288cb37
|
4
|
+
data.tar.gz: f39b9f3ae08503660b79bcc0d286ae622d5e0aa5c06b056ef635a8af8def8576
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de5bfd72e7ea4b31e0bf57785ea38d5503624f0861adc660c1844848d32d839a90ecfb0ed6f5de1eabe13293846fd1771be45bb8f373725eabf6aed092fb50bf
|
7
|
+
data.tar.gz: bd38063b3c625ac4296dacff7ca0499192bcbb140f744ea7a063a8fe4e3f98c5f1a1ee93831242592e0f744fecef512081f5fc5c9f134751dba6ea91d14e0285
|
data/README.md
CHANGED
@@ -8,6 +8,8 @@ gem install quality-report
|
|
8
8
|
|
9
9
|
## Usage
|
10
10
|
|
11
|
+
Change to a project directory that contains `*.rb` files. Then:
|
12
|
+
|
11
13
|
```sh
|
12
14
|
ruby-quality-report
|
13
15
|
```
|
@@ -16,7 +18,7 @@ After a bit of a wait, it outputs a report in table form:
|
|
16
18
|
|
17
19
|

|
18
20
|
|
19
|
-
This is showing, for each author, the percentage of problematic lines of code. Lower is better.
|
21
|
+
This is showing, for each author, the percentage of problematic lines of code in the repo. Lower is better.
|
20
22
|
|
21
23
|
|
22
24
|
### For improved relevance, it has two filters.
|
@@ -44,7 +46,7 @@ It runs a subset of [Rubocop Metrics cops](https://docs.rubocop.org/rubocop/cops
|
|
44
46
|
- [Method Length](https://docs.rubocop.org/rubocop/cops_metrics.html#metricsmethodlength)
|
45
47
|
- [Perceived Complexity](https://docs.rubocop.org/rubocop/cops_metrics.html#metricsperceivedcomplexity)
|
46
48
|
|
47
|
-
|
49
|
+
Then, using git, it calculates the percentage of warnings per line written, per author. Each failing check is another warning.
|
48
50
|
|
49
51
|
|
50
52
|
## Intent
|
@@ -56,7 +58,7 @@ This is a team management tool to:
|
|
56
58
|
|
57
59
|
## Foundational Research
|
58
60
|
|
59
|
-
Diving 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
|
61
|
+
Diving 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.
|
60
62
|
|
61
63
|
This 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].
|
62
64
|
|
@@ -69,13 +71,13 @@ Complex code introduces bugs in a second, more subtle way. This is because code
|
|
69
71
|
|
70
72
|
## Roadmap
|
71
73
|
|
72
|
-
- [
|
73
|
-
- [
|
74
|
-
- [ ] Add a `--csv` option.
|
75
|
-
- [ ] Make the filters configurable.
|
76
|
-
- [ ] Speed up the scan.
|
74
|
+
- [x] Colorize the output to separate high, medium, and low warning percentages.
|
75
|
+
- [x] Fix the numerical alignment.
|
77
76
|
- [ ] Add a progress bar.
|
77
|
+
- [ ] Speed up the scan.
|
78
78
|
- [ ] Refactor from script-style coding to a more standard Ruby project.
|
79
|
+
- [ ] Make the filters configurable.
|
80
|
+
- [ ] Add a `--csv` option.
|
79
81
|
|
80
82
|
|
81
83
|
## Contributing
|
data/exe/ruby-quality-report
CHANGED
@@ -49,10 +49,10 @@ def generate_table(combined_stats)
|
|
49
49
|
|
50
50
|
table_data.each do |stats|
|
51
51
|
table << [
|
52
|
-
{ value: stats[:label],
|
53
|
-
{ value: "#{stats[:percent]}%",
|
54
|
-
{ value: stats[:part_count],
|
55
|
-
{ value: stats[:whole_count],
|
52
|
+
{ value: stats[:label], alignment: :left },
|
53
|
+
{ value: "#{stats[:percent]}%", alignment: :right },
|
54
|
+
{ value: int_to_accounting(stats[:part_count]), alignment: :right },
|
55
|
+
{ value: int_to_accounting(stats[:whole_count]), alignment: :right }
|
56
56
|
]
|
57
57
|
end
|
58
58
|
|
@@ -109,8 +109,21 @@ def no_commits_in_last_60_days?(stats)
|
|
109
109
|
last_commit_time < sixty_days_ago
|
110
110
|
end
|
111
111
|
|
112
|
+
###
|
113
|
+
# Converts a float to an integer percentage
|
114
|
+
#
|
112
115
|
def float_to_percent(a_float)
|
113
|
-
(Float(a_float) * 100).round
|
116
|
+
(Float(a_float) * 100).round
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Converts an integer to a string with commas separating thousands.
|
121
|
+
#
|
122
|
+
# An alternative implementation is:
|
123
|
+
# an_int.to_s.gsub(/(\d)(?=(\d{3})+(?!\d))/, '\\1,')
|
124
|
+
#
|
125
|
+
def int_to_accounting(an_int)
|
126
|
+
an_int.to_s.reverse.gsub(/(\d{3})(?=\d)/, '\\1,').reverse
|
114
127
|
end
|
115
128
|
|
116
129
|
#
|
data/screenshot-1@2x.webp
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quality_report
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robb Shecter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-11-
|
11
|
+
date: 2024-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|