attractor 2.7.1 → 2.7.2
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/lib/attractor/calculators/base_calculator.rb +12 -6
- data/lib/attractor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8f25163f3110bce204d78b6bbffb42973582b2950f7a3905949c255ad2392588
|
|
4
|
+
data.tar.gz: 1bf00d54220e67400a7eadcb6f9b33ab34e6a60100df5e3997861151d2ad2410
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 29d2e731e695406b7e247806c7a1e3cab15f555df0fd0dd90d455d14513db6722d77f8747b2f64426ecb611599eef91bcf39824066d60536503d52e3fd1b4292
|
|
7
|
+
data.tar.gz: f71bc7dd89144521716bd9a4671c5e065113c6bb727b9da19001f3a73d5cdf4c942c7d829242c911a90811cf4404ba84094cd094b8033b92600763de21e28963
|
|
@@ -45,13 +45,9 @@ module Attractor
|
|
|
45
45
|
puts "Calculating churn and complexity values for #{target_paths.size} #{type} files" if @verbose
|
|
46
46
|
|
|
47
47
|
values = target_paths.filter_map do |file_path|
|
|
48
|
-
change = changes_by_path[file_path]
|
|
48
|
+
change = changes_by_path[file_path] || listed_file_change(file_path)
|
|
49
49
|
|
|
50
|
-
if change
|
|
51
|
-
build_value(change) { |c| yield(c) if block_given? }
|
|
52
|
-
elsif @files && !@files.empty? && !File.exist?(file_path)
|
|
53
|
-
missing_value(file_path)
|
|
54
|
-
end
|
|
50
|
+
build_value(change) { |c| yield(c) if block_given? } if change
|
|
55
51
|
end
|
|
56
52
|
|
|
57
53
|
Cache.persist!
|
|
@@ -63,6 +59,16 @@ module Attractor
|
|
|
63
59
|
|
|
64
60
|
private
|
|
65
61
|
|
|
62
|
+
# The churn report only covers commits newer than `start_ago`, so a listed file whose last
|
|
63
|
+
# commit is older than that never appears in it. It still has to be scored: `attractor diff`
|
|
64
|
+
# asks for an explicit file list, and dropping one leaves `complexity_base` nil, which reads
|
|
65
|
+
# as if the file had just been added. Churn is 0 here because that is what the window says.
|
|
66
|
+
def listed_file_change(file_path)
|
|
67
|
+
return unless @files && !@files.empty?
|
|
68
|
+
|
|
69
|
+
{file_path: file_path, times_changed: 0}
|
|
70
|
+
end
|
|
71
|
+
|
|
66
72
|
def build_value(change)
|
|
67
73
|
if @files && !@files.empty? && !File.exist?(change[:file_path])
|
|
68
74
|
return missing_value(change[:file_path], churn: change[:times_changed])
|
data/lib/attractor/version.rb
CHANGED