decko-commons/decko

View on GitHub
card/spec/card/diff_spec.rb

Summary

Maintainability
A
50 mins
Test Coverage

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    it "green ellipsis if added text does not fit" do
      a = "123"
      b = "5678"
      expect(summary(a, b, summary: { length: 6 })).to eq(
        "#{del '123'}#{ins '...'}"
Severity: Minor
Found in card/spec/card/diff_spec.rb and 2 other locations - About 15 mins to fix
card/spec/card/diff_spec.rb on lines 75..79
card/spec/card/diff_spec.rb on lines 107..111

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

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).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

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.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    it "no ellipsis if changes fit exactly" do
      a = "123"
      b = "456"
      expect(summary(a, b, summary: { length: 6 })).to eq(
        "#{del '123'}#{ins '456'}"
Severity: Minor
Found in card/spec/card/diff_spec.rb and 2 other locations - About 15 mins to fix
card/spec/card/diff_spec.rb on lines 83..87
card/spec/card/diff_spec.rb on lines 107..111

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

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).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

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.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

    it "green ellipsis if added text partially fits" do
      a = "1234"
      b = "56789"
      expect(summary(a, b, summary: { length: 8 })).to eq(
        "#{del '1234'}#{ins '5...'}"
Severity: Minor
Found in card/spec/card/diff_spec.rb and 2 other locations - About 15 mins to fix
card/spec/card/diff_spec.rb on lines 75..79
card/spec/card/diff_spec.rb on lines 83..87

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

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).

Tuning

This issue has a mass of 26.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

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.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Start context description with 'when', 'with', or 'without'.
Open

  context "pointer format" do
Severity: Minor
Found in card/spec/card/diff_spec.rb by rubocop

Spec path should end with /content/diff*_spec.rb.
Open

RSpec.describe Card::Content::Diff do
Severity: Minor
Found in card/spec/card/diff_spec.rb by rubocop

Start context description with 'when', 'with', or 'without'.
Open

  context "text format" do
Severity: Minor
Found in card/spec/card/diff_spec.rb by rubocop

Start context description with 'when', 'with', or 'without'.
Open

  context "html format" do
Severity: Minor
Found in card/spec/card/diff_spec.rb by rubocop

Start context description with 'when', 'with', or 'without'.
Open

  context "raw format" do
Severity: Minor
Found in card/spec/card/diff_spec.rb by rubocop

There are no issues that match your filters.

Category
Status