feature_map 1.2.8 → 1.3.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/lib/feature_map/private/assignment_mappers/directory_assignment.rb +4 -4
- data/lib/feature_map/private/assignments_file.rb +2 -2
- data/lib/feature_map/private/cyclomatic_complexity_calculator.rb +4 -2
- data/lib/feature_map/private/docs/index.html +75 -243
- data/lib/feature_map/private/feature_metrics_calculator.rb +6 -3
- data/lib/feature_map/private/lines_of_code_calculator.rb +0 -2
- data/lib/feature_map/private/test_pyramid/jest_mapper.rb +2 -2
- data/lib/feature_map/private/test_pyramid_file.rb +3 -3
- data/lib/feature_map.rb +6 -4
- metadata +17 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2884ba23322300d08303fe36c12905f55b5e1c09ef9448be9e1a8d093bb5f980
|
|
4
|
+
data.tar.gz: bfeaaede286478020203d1442be552db58a00a05668bc8aeca5a8e4555d11c16
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b16a793030fed72ee5ded687166df231a60d1c602ed543201dc84b00d20a48c0f5d31d37b0d31d97356e47f386742f9499330acae7950dd407a1a77b30b9f6b8
|
|
7
|
+
data.tar.gz: 2e84d7222ed3bf8e8d42e67994c223686ca8fd7e9bdaf8d34966464dea6b47e6323455a3392245deaca3713cdc37b080f40fd279603fd4e8d8b792258e751b8d
|
|
@@ -31,10 +31,10 @@ module FeatureMap
|
|
|
31
31
|
.glob(File.join('**/', FEATURE_DIRECTORY_ASSIGNMENT_FILE_NAME))
|
|
32
32
|
.map(&:cleanpath)
|
|
33
33
|
.each_with_object({}) do |pathname, res|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
feature = feature_for_directory_assignment_file(pathname)
|
|
35
|
+
glob = glob_for_directory_assignment_file(pathname)
|
|
36
|
+
res[glob] = feature
|
|
37
|
+
end
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def description
|
|
@@ -113,8 +113,8 @@ module FeatureMap
|
|
|
113
113
|
|
|
114
114
|
def self.to_glob_cache
|
|
115
115
|
raw_cache_contents = {}
|
|
116
|
-
features_by_name = CodeFeatures.all.
|
|
117
|
-
|
|
116
|
+
features_by_name = CodeFeatures.all.to_h do |feature|
|
|
117
|
+
[feature.name, feature]
|
|
118
118
|
end
|
|
119
119
|
mapper_descriptions = Set.new(Mapper.all.map(&:description))
|
|
120
120
|
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# @feature Metrics Calculation
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
require 'parser/current'
|
|
5
|
-
|
|
6
4
|
module FeatureMap
|
|
7
5
|
module Private
|
|
8
6
|
class CyclomaticComplexityCalculator
|
|
@@ -17,6 +15,10 @@ module FeatureMap
|
|
|
17
15
|
end
|
|
18
16
|
|
|
19
17
|
def calculate
|
|
18
|
+
# Lazy load the parser gem only when we need to process AST nodes to avoid introducing unnecessary
|
|
19
|
+
# dependencies for use cases that do not exercise this functionality.
|
|
20
|
+
require 'parser/current'
|
|
21
|
+
|
|
20
22
|
process(@ast)
|
|
21
23
|
@complexity
|
|
22
24
|
end
|