vmesel/PyJobs

View on GitHub

Showing 73 of 76 total issues

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

    @freeze_time("2019-10-29")
    def test_run_command_on_wrong_date(self):
        out = StringIO()
        sys.stdout = out
        call_command("send_weekly_summary", stdout=out)
Severity: Major
Found in pyjobs/core/tests/test_commands.py and 4 other locations - About 2 hrs to fix
pyjobs/core/tests/test_command_mailing.py on lines 45..50
pyjobs/core/tests/test_command_mailing.py on lines 62..67
pyjobs/core/tests/test_command_mailing.py on lines 76..81
pyjobs/core/tests/test_commands.py on lines 127..132

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

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

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

        self.job_application = JobApplication.objects.create(
            job=self.job,
            user=self.profile.user,
            email_sent_at=datetime.now() - timedelta(days=4),
Severity: Major
Found in pyjobs/core/tests/test_forms.py and 2 other locations - About 2 hrs to fix
pyjobs/core/tests/test_commands.py on lines 53..56
pyjobs/core/tests/test_forms.py on lines 185..188

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

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

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

        self.job_application = JobApplication.objects.create(
            job=self.job,
            user=self.profile.user,
            email_sent_at=datetime.now() - timedelta(days=4),
Severity: Major
Found in pyjobs/core/tests/test_commands.py and 2 other locations - About 2 hrs to fix
pyjobs/core/tests/test_forms.py on lines 72..75
pyjobs/core/tests/test_forms.py on lines 185..188

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

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 5 locations. Consider refactoring.
Open

    @freeze_time("2019-10-29")
    def test_called_command_with_wrong_date(self):
        out = StringIO()
        sys.stdout = out
        call_command("send_weekly_mailing", stdout=out)
Severity: Major
Found in pyjobs/core/tests/test_command_mailing.py and 4 other locations - About 2 hrs to fix
pyjobs/core/tests/test_command_mailing.py on lines 62..67
pyjobs/core/tests/test_command_mailing.py on lines 76..81
pyjobs/core/tests/test_commands.py on lines 120..125
pyjobs/core/tests/test_commands.py on lines 127..132

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

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 5 locations. Consider refactoring.
Open

    @freeze_time("2019-10-29")
    def test_called_command_with_no_jobs_wrong_date(self):
        out = StringIO()
        sys.stdout = out
        call_command("send_weekly_mailing", stdout=out)
Severity: Major
Found in pyjobs/core/tests/test_command_mailing.py and 4 other locations - About 2 hrs to fix
pyjobs/core/tests/test_command_mailing.py on lines 45..50
pyjobs/core/tests/test_command_mailing.py on lines 62..67
pyjobs/core/tests/test_commands.py on lines 120..125
pyjobs/core/tests/test_commands.py on lines 127..132

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

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 5 locations. Consider refactoring.
Open

    @freeze_time("2019-10-28")
    def test_run_command_on_right_date(self):
        out = StringIO()
        sys.stdout = out
        call_command("send_weekly_summary", stdout=out)
Severity: Major
Found in pyjobs/core/tests/test_commands.py and 4 other locations - About 2 hrs to fix
pyjobs/core/tests/test_command_mailing.py on lines 45..50
pyjobs/core/tests/test_command_mailing.py on lines 62..67
pyjobs/core/tests/test_command_mailing.py on lines 76..81
pyjobs/core/tests/test_commands.py on lines 120..125

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

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 5 locations. Consider refactoring.
Open

    @freeze_time("2019-10-29")
    def test_called_command_with_no_jobs_wrong_date(self):
        out = StringIO()
        sys.stdout = out
        call_command("send_weekly_mailing", stdout=out)
Severity: Major
Found in pyjobs/core/tests/test_command_mailing.py and 4 other locations - About 2 hrs to fix
pyjobs/core/tests/test_command_mailing.py on lines 45..50
pyjobs/core/tests/test_command_mailing.py on lines 76..81
pyjobs/core/tests/test_commands.py on lines 120..125
pyjobs/core/tests/test_commands.py on lines 127..132

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

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

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

        self.job_application = JobApplication.objects.create(
            job=self.job,
            user=self.profile.user,
            email_sent_at=datetime.now() - timedelta(days=4),
Severity: Major
Found in pyjobs/core/tests/test_forms.py and 2 other locations - About 2 hrs to fix
pyjobs/core/tests/test_commands.py on lines 53..56
pyjobs/core/tests/test_forms.py on lines 72..75

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

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 2 locations. Consider refactoring.
Open

Severity: Major
Found in pyjobs/core/tests/test_apps.py and 1 other location - About 2 hrs to fix
pyjobs/marketing/tests/test_apps.py on lines 0..9

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

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 2 locations. Consider refactoring.
Open

Severity: Major
Found in pyjobs/marketing/tests/test_apps.py and 1 other location - About 2 hrs to fix
pyjobs/core/tests/test_apps.py on lines 0..9

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

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

Function process_response has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def process_response(self, request, response):
        response["Cache-Control"] = "max-age=%d" % MAX_AGE
        if response.status_code != 404:
            return response

Severity: Minor
Found in pyjobs/middleware.py - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    def test_if_status_code_is_two_hundred_on_password_change(self):
        self.client.login(username="jacob", password="top_secret")
        response = self.client.get("/user/password/")
        self.assertEqual(200, response.status_code)
Severity: Major
Found in pyjobs/core/tests/test_views.py and 2 other locations - About 1 hr to fix
pyjobs/core/tests/test_views.py on lines 118..121
pyjobs/core/tests/test_views.py on lines 127..130

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

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

    def test_if_status_code_is_two_hundred_on(self):
        self.client.login(username="jacob", password="top_secret")
        response = self.client.get("/user/info/")
        self.assertEqual(200, response.status_code)
Severity: Major
Found in pyjobs/core/tests/test_views.py and 2 other locations - About 1 hr to fix
pyjobs/core/tests/test_views.py on lines 113..116
pyjobs/core/tests/test_views.py on lines 118..121

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

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

    def test_if_status_code_is_two_hundred_on_pythonistas_home(self):
        self.client.login(username="jacob", password="top_secret")
        response = self.client.get("/user/")
        self.assertEqual(200, response.status_code)
Severity: Major
Found in pyjobs/core/tests/test_views.py and 2 other locations - About 1 hr to fix
pyjobs/core/tests/test_views.py on lines 113..116
pyjobs/core/tests/test_views.py on lines 127..130

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

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

Function subscribe has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function subscribe(reg) {
  // Get the Subscription or register one
  reg.pushManager.getSubscription().then(
    function(subscription) {
      var metaObj, applicationServerKey, options;
Severity: Minor
Found in pyjobs/staticfiles/webpush/webpush.js - About 1 hr to fix

    Function unsubscribe has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function unsubscribe(reg) {
      // Get the Subscription to unregister
      reg.pushManager.getSubscription()
        .then(
          function(subscription) {
    Severity: Minor
    Found in pyjobs/staticfiles/webpush/webpush.js - About 1 hr to fix

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

          email = forms.EmailField(
              label=_("Seu e-mail"),
              widget=forms.TextInput(attrs={"placeholder": _("seu-email@atualizado.com")}),
      Severity: Major
      Found in pyjobs/core/forms.py and 4 other locations - About 1 hr to fix
      pyjobs/core/forms.py on lines 90..92
      pyjobs/core/forms.py on lines 96..98
      pyjobs/core/forms.py on lines 102..104
      pyjobs/core/forms.py on lines 108..110

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

      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

      Function handle has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          def handle(self, *args, **options):
              if not settings.GITHUB_ACCESS_TOKEN or not settings.GITHUB_DEFAULT_REPO:
                  return "False"
      
              g = Github(settings.GITHUB_ACCESS_TOKEN)
      Severity: Minor
      Found in pyjobs/synchronizer/management/commands/load_jobs_from_github.py - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

          github = forms.URLField(
              label=_("Github (opcional)"),
              widget=forms.TextInput(attrs={"placeholder": _("Link do seu GitHub")}),
      Severity: Major
      Found in pyjobs/core/forms.py and 4 other locations - About 1 hr to fix
      pyjobs/core/forms.py on lines 96..98
      pyjobs/core/forms.py on lines 102..104
      pyjobs/core/forms.py on lines 108..110
      pyjobs/core/forms.py on lines 161..163

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

      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 5 locations. Consider refactoring.
      Open

          portfolio = forms.URLField(
              label=_("Portfolio (opcional)"),
              widget=forms.TextInput(attrs={"placeholder": _("Link do seu portfolio")}),
      Severity: Major
      Found in pyjobs/core/forms.py and 4 other locations - About 1 hr to fix
      pyjobs/core/forms.py on lines 90..92
      pyjobs/core/forms.py on lines 96..98
      pyjobs/core/forms.py on lines 108..110
      pyjobs/core/forms.py on lines 161..163

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

      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

      Severity
      Category
      Status
      Source
      Language