Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit bff607c

Browse files
author
Ashley Baldwin-Hunter
committed
Merge pull request #90 from codeclimate/abh-readup
Highlight configuration docs in readup
2 parents cfa0a87 + a5e514e commit bff607c

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

‎config/contents/duplicated_code.md.erb‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ Duplicated code can lead to software that is hard to understand and difficult to
66

77
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
88

9-
## Issue Mass
9+
## Tuning
1010

11-
Duplicated code has a calculated mass, which can be thought of as a measure of how much logic has been duplicated.
12-
This issue has a mass of `<%= mass %>`: if you would like to change the minimum mass that will be reported as an issue, please see the details in [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication).
11+
**This issue has a mass of <%= mass %>**.
12+
13+
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
14+
15+
The threshold configuration represents the minimum [mass](https://docs.codeclimate.com/docs/duplication#mass) a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
16+
17+
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
18+
19+
See [`codeclimate-duplication`'s documentation](https://docs.codeclimate.com/docs/duplication) for more information about tuning the mass threshold in your `.codeclimate.yml`.
1320

1421
## Refactorings
1522

‎spec/cc/engine/analyzers/javascript/main_spec.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
{"path" => "foo.js", "lines" => { "begin" => 2, "end" => 2} },
3333
{"path" => "foo.js", "lines" => { "begin" => 3, "end" => 3} }
3434
])
35-
expect(json["content"]["body"]).to match /This issue has a mass of `11`/
35+
expect(json["content"]["body"]).to match /This issue has a mass of 11/
3636
expect(json["fingerprint"]).to eq("c4d29200c20d02297c6f550ad2c87c15")
3737
end
3838

@@ -60,7 +60,7 @@
6060
{"path" => "foo.js", "lines" => { "begin" => 2, "end" => 2} },
6161
{"path" => "foo.js", "lines" => { "begin" => 3, "end" => 3} }
6262
])
63-
expect(json["content"]["body"]).to match /This issue has a mass of `11`/
63+
expect(json["content"]["body"]).to match /This issue has a mass of 11/
6464
expect(json["fingerprint"]).to eq("d9dab8e4607e2a74da3b9eefb49eacec")
6565
end
6666

‎spec/cc/engine/analyzers/php/main_spec.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
expect(json["other_locations"]).to eq([
4545
{"path" => "foo.php", "lines" => { "begin" => 10, "end" => 14} },
4646
])
47-
expect(json["content"]["body"]).to match /This issue has a mass of `11`/
47+
expect(json["content"]["body"]).to match /This issue has a mass of 11/
4848
expect(json["fingerprint"]).to eq("8234e10d96fd6ef608085c22c91c9ab1")
4949
end
5050

‎spec/cc/engine/analyzers/python/main_spec.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
{"path" => "foo.py", "lines" => { "begin" => 2, "end" => 2} },
3232
{"path" => "foo.py", "lines" => { "begin" => 3, "end" => 3} }
3333
])
34-
expect(json["content"]["body"]).to match /This issue has a mass of `6`/
34+
expect(json["content"]["body"]).to match /This issue has a mass of 6/
3535
expect(json["fingerprint"]).to eq("3f3d34361bcaef98839d9da6ca9fcee4")
3636
end
3737

@@ -59,7 +59,7 @@
5959
{"path" => "foo.py", "lines" => { "begin" => 2, "end" => 2} },
6060
{"path" => "foo.py", "lines" => { "begin" => 3, "end" => 3} }
6161
])
62-
expect(json["content"]["body"]).to match /This issue has a mass of `6`/
62+
expect(json["content"]["body"]).to match /This issue has a mass of 6/
6363
expect(json["fingerprint"]).to eq("019118ceed60bf40b35aad581aae1b02")
6464
end
6565

‎spec/cc/engine/analyzers/ruby/main_spec.rb‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def self.sub_degrees(str)
5656
expect(json["other_locations"]).to eq([
5757
{"path" => "foo.rb", "lines" => { "begin" => 9, "end" => 13} },
5858
])
59-
expect(json["content"]["body"]).to match /This issue has a mass of `18`/
59+
expect(json["content"]["body"]).to match /This issue has a mass of 18/
6060
expect(json["fingerprint"]).to eq("b7e46d8f5164922678e48942e26100f2")
6161
end
6262

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /