skunk 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -2
- data/lib/skunk/rubycritic/analysed_module.rb +2 -2
- data/lib/skunk/version.rb +1 -1
- data/samples/rubycritic/analysed_module.rb +2 -10
- data/skunk.gemspec +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: 31e5fabed605521119f56bd2d3391bf8f206562deeea374685ed9c2fa549e0f9
|
4
|
+
data.tar.gz: e5a42b34af7d2162a25b4ab91abaa33dec4930c4c58ee44c9ecd1e74f05661e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6ec99d947845d5bb77f2efa446078e0fc20658c67b1bd75e618dbbe3d453403e080798124cf7d60e5799573e636ac6847fdecd1a4b37ad8404e766937530133b
|
7
|
+
data.tar.gz: 51cdff8ee198c28b6281d5176e103b9af3f716656ef411716a945f9c21dbfe36894533849ac7b1090904073a10b0dc5131f7228fc16a23e4d0e7894abd77db81
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,9 +9,8 @@ A RubyCritic extension to calculate StinkScore for a file or project.
|
|
9
9
|
The StinkScore is a value that assesses the quality of a module. It takes into
|
10
10
|
account:
|
11
11
|
|
12
|
-
- Code
|
12
|
+
- Code Complexity
|
13
13
|
- Code Smells
|
14
|
-
- Churn
|
15
14
|
- Code Coverage
|
16
15
|
|
17
16
|
The main goal of the StinkScore is to serve as a compass in your next
|
@@ -31,9 +31,9 @@ module RubyCritic
|
|
31
31
|
#
|
32
32
|
# @return [Float]
|
33
33
|
def stink_score
|
34
|
-
return
|
34
|
+
return cost.round(2) if coverage == PERFECT_COVERAGE
|
35
35
|
|
36
|
-
(
|
36
|
+
(cost * (PERFECT_COVERAGE - coverage.to_i)).round(2)
|
37
37
|
end
|
38
38
|
|
39
39
|
# Returns the value of churn times cost.
|
data/lib/skunk/version.rb
CHANGED
@@ -31,17 +31,9 @@ module RubyCritic
|
|
31
31
|
#
|
32
32
|
# @return [Float]
|
33
33
|
def stink_score
|
34
|
-
return
|
34
|
+
return cost.round(2) if coverage == PERFECT_COVERAGE
|
35
35
|
|
36
|
-
(
|
37
|
-
end
|
38
|
-
|
39
|
-
# Returns the value of churn times cost.
|
40
|
-
#
|
41
|
-
# @return [Integer]
|
42
|
-
def churn_times_cost
|
43
|
-
safe_churn = churn.positive? ? churn : 1
|
44
|
-
@churn_times_cost ||= safe_churn * cost
|
36
|
+
(cost * (PERFECT_COVERAGE - coverage.to_i)).round(2)
|
45
37
|
end
|
46
38
|
end
|
47
39
|
end
|
data/skunk.gemspec
CHANGED
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
|
|
9
9
|
spec.version = Skunk::VERSION
|
10
10
|
spec.authors = ["Ernesto Tagwerker"]
|
11
11
|
spec.email = ["ernesto+github@ombulabs.com"]
|
12
|
-
spec.licenses = [
|
12
|
+
spec.licenses = ["MIT"]
|
13
13
|
spec.summary = "A library to assess code quality vs. code coverage"
|
14
14
|
spec.description = "Knows how to calculate the StinkScore for a Ruby file"
|
15
15
|
spec.homepage = "https://github.com/fastruby/skunk"
|