ClusterLabs/hawk

View on GitHub

Showing 238 of 2,376 total issues

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

        if (state.running) {
          // repeat...
        } else {
          if (running_timeout !== null) {
            clearInterval(running_timeout);
Severity: Major
Found in hawk/app/assets/javascripts/module/reports.js and 1 other location - About 2 hrs to fix
hawk/app/assets/javascripts/module/reports.js on lines 41..51

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

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

  def update
    normalize_params! params[:primitive].permit!
    @title = _("Edit Primitive")

    if params[:revert]
Severity: Major
Found in hawk/app/controllers/primitives_controller.rb and 8 other locations - About 2 hrs to fix
hawk/app/controllers/clones_controller.rb on lines 68..93
hawk/app/controllers/colocations_controller.rb on lines 67..92
hawk/app/controllers/groups_controller.rb on lines 68..93
hawk/app/controllers/locations_controller.rb on lines 86..111
hawk/app/controllers/masters_controller.rb on lines 68..93
hawk/app/controllers/orders_controller.rb on lines 68..93
hawk/app/controllers/tags_controller.rb on lines 64..89
hawk/app/controllers/tickets_controller.rb on lines 77..102

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

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

  def update
    normalize_params! params[:location].permit!
    @title = _('Edit Location Constraint')

    if params[:revert]
Severity: Major
Found in hawk/app/controllers/locations_controller.rb and 8 other locations - About 2 hrs to fix
hawk/app/controllers/clones_controller.rb on lines 68..93
hawk/app/controllers/colocations_controller.rb on lines 67..92
hawk/app/controllers/groups_controller.rb on lines 68..93
hawk/app/controllers/masters_controller.rb on lines 68..93
hawk/app/controllers/orders_controller.rb on lines 68..93
hawk/app/controllers/primitives_controller.rb on lines 97..122
hawk/app/controllers/tags_controller.rb on lines 64..89
hawk/app/controllers/tickets_controller.rb on lines 77..102

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

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

  def update
    normalize_params! params[:colocation].permit!
    @title = _("Edit Colocation")

    if params[:revert]
Severity: Major
Found in hawk/app/controllers/colocations_controller.rb and 8 other locations - About 2 hrs to fix
hawk/app/controllers/clones_controller.rb on lines 68..93
hawk/app/controllers/groups_controller.rb on lines 68..93
hawk/app/controllers/locations_controller.rb on lines 86..111
hawk/app/controllers/masters_controller.rb on lines 68..93
hawk/app/controllers/orders_controller.rb on lines 68..93
hawk/app/controllers/primitives_controller.rb on lines 97..122
hawk/app/controllers/tags_controller.rb on lines 64..89
hawk/app/controllers/tickets_controller.rb on lines 77..102

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

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

  def update
    normalize_params! params[:group].permit!
    @title = _("Edit Group")

    if params[:revert]
Severity: Major
Found in hawk/app/controllers/groups_controller.rb and 8 other locations - About 2 hrs to fix
hawk/app/controllers/clones_controller.rb on lines 68..93
hawk/app/controllers/colocations_controller.rb on lines 67..92
hawk/app/controllers/locations_controller.rb on lines 86..111
hawk/app/controllers/masters_controller.rb on lines 68..93
hawk/app/controllers/orders_controller.rb on lines 68..93
hawk/app/controllers/primitives_controller.rb on lines 97..122
hawk/app/controllers/tags_controller.rb on lines 64..89
hawk/app/controllers/tickets_controller.rb on lines 77..102

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

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

  def update
    normalize_params! params[:order].permit!
    @title = _("Edit Order")

    if params[:revert]
Severity: Major
Found in hawk/app/controllers/orders_controller.rb and 8 other locations - About 2 hrs to fix
hawk/app/controllers/clones_controller.rb on lines 68..93
hawk/app/controllers/colocations_controller.rb on lines 67..92
hawk/app/controllers/groups_controller.rb on lines 68..93
hawk/app/controllers/locations_controller.rb on lines 86..111
hawk/app/controllers/masters_controller.rb on lines 68..93
hawk/app/controllers/primitives_controller.rb on lines 97..122
hawk/app/controllers/tags_controller.rb on lines 64..89
hawk/app/controllers/tickets_controller.rb on lines 77..102

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

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

  def update
    normalize_params! params[:master].permit!
    @title = _("Edit Promotable resource")

    if params[:revert]
Severity: Major
Found in hawk/app/controllers/masters_controller.rb and 8 other locations - About 2 hrs to fix
hawk/app/controllers/clones_controller.rb on lines 68..93
hawk/app/controllers/colocations_controller.rb on lines 67..92
hawk/app/controllers/groups_controller.rb on lines 68..93
hawk/app/controllers/locations_controller.rb on lines 86..111
hawk/app/controllers/orders_controller.rb on lines 68..93
hawk/app/controllers/primitives_controller.rb on lines 97..122
hawk/app/controllers/tags_controller.rb on lines 64..89
hawk/app/controllers/tickets_controller.rb on lines 77..102

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

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

  def update
    normalize_params! params[:clone].permit!
    @title = _("Edit Clone")

    if params[:revert]
Severity: Major
Found in hawk/app/controllers/clones_controller.rb and 8 other locations - About 2 hrs to fix
hawk/app/controllers/colocations_controller.rb on lines 67..92
hawk/app/controllers/groups_controller.rb on lines 68..93
hawk/app/controllers/locations_controller.rb on lines 86..111
hawk/app/controllers/masters_controller.rb on lines 68..93
hawk/app/controllers/orders_controller.rb on lines 68..93
hawk/app/controllers/primitives_controller.rb on lines 97..122
hawk/app/controllers/tags_controller.rb on lines 64..89
hawk/app/controllers/tickets_controller.rb on lines 77..102

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

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

  def update
    normalize_params! params[:tag].permit!
    @title = _("Edit Tag")

    if params[:revert]
Severity: Major
Found in hawk/app/controllers/tags_controller.rb and 8 other locations - About 2 hrs to fix
hawk/app/controllers/clones_controller.rb on lines 68..93
hawk/app/controllers/colocations_controller.rb on lines 67..92
hawk/app/controllers/groups_controller.rb on lines 68..93
hawk/app/controllers/locations_controller.rb on lines 86..111
hawk/app/controllers/masters_controller.rb on lines 68..93
hawk/app/controllers/orders_controller.rb on lines 68..93
hawk/app/controllers/primitives_controller.rb on lines 97..122
hawk/app/controllers/tickets_controller.rb on lines 77..102

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

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

  def update
    normalize_params! params[:ticket].permit!
    @title = _("Edit Ticket")

    if params[:revert]
Severity: Major
Found in hawk/app/controllers/tickets_controller.rb and 8 other locations - About 2 hrs to fix
hawk/app/controllers/clones_controller.rb on lines 68..93
hawk/app/controllers/colocations_controller.rb on lines 67..92
hawk/app/controllers/groups_controller.rb on lines 68..93
hawk/app/controllers/locations_controller.rb on lines 86..111
hawk/app/controllers/masters_controller.rb on lines 68..93
hawk/app/controllers/orders_controller.rb on lines 68..93
hawk/app/controllers/primitives_controller.rb on lines 97..122
hawk/app/controllers/tags_controller.rb on lines 64..89

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

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

RSpec.describe Api::V1::StatusController do

  context 'without a valid token' do
    before do
      pass_fake_yaml_store
Severity: Major
Found in hawk/spec/controllers/api/v1/status_controller_spec.rb and 3 other locations - About 2 hrs to fix
hawk/spec/controllers/api/v1/cluster_controller_spec.rb on lines 4..42
hawk/spec/controllers/api/v1/nodes_controller_spec.rb on lines 4..42
hawk/spec/controllers/api/v1/resources_controller_spec.rb on lines 4..42

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

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

RSpec.describe Api::V1::ResourcesController do

  context 'without a valid token' do
    before do
      pass_fake_yaml_store
Severity: Major
Found in hawk/spec/controllers/api/v1/resources_controller_spec.rb and 3 other locations - About 2 hrs to fix
hawk/spec/controllers/api/v1/cluster_controller_spec.rb on lines 4..42
hawk/spec/controllers/api/v1/nodes_controller_spec.rb on lines 4..42
hawk/spec/controllers/api/v1/status_controller_spec.rb on lines 4..42

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

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

  def update
    @title = _("Edit ACL Target")

    if params[:revert]
      return redirect_to edit_cib_user_url(cib_id: @cib.id, id: @user.id)
Severity: Major
Found in hawk/app/controllers/users_controller.rb and 1 other location - About 2 hrs to fix
hawk/app/controllers/roles_controller.rb on lines 62..86

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

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

RSpec.describe Api::V1::ClusterController do

  context 'without a valid token' do
    before do
      pass_fake_yaml_store
Severity: Major
Found in hawk/spec/controllers/api/v1/cluster_controller_spec.rb and 3 other locations - About 2 hrs to fix
hawk/spec/controllers/api/v1/nodes_controller_spec.rb on lines 4..42
hawk/spec/controllers/api/v1/resources_controller_spec.rb on lines 4..42
hawk/spec/controllers/api/v1/status_controller_spec.rb on lines 4..42

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

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

RSpec.describe Api::V1::NodesController do

  context 'without a valid token' do
    before do
      pass_fake_yaml_store
Severity: Major
Found in hawk/spec/controllers/api/v1/nodes_controller_spec.rb and 3 other locations - About 2 hrs to fix
hawk/spec/controllers/api/v1/cluster_controller_spec.rb on lines 4..42
hawk/spec/controllers/api/v1/resources_controller_spec.rb on lines 4..42
hawk/spec/controllers/api/v1/status_controller_spec.rb on lines 4..42

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

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

  def update
    @title = _("Edit Role")

    if params[:revert]
      return redirect_to edit_cib_role_url(cib_id: @cib.id, id: @role.id)
Severity: Major
Found in hawk/app/controllers/roles_controller.rb and 1 other location - About 2 hrs to fix
hawk/app/controllers/users_controller.rb on lines 64..88

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

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

      } else {
        $(this)
          .addClass('collapsed')
          .parents('fieldset')
          .find('.content')
Severity: Major
Found in hawk/app/assets/javascripts/module/basics.js and 1 other location - About 1 hr to fix
hawk/app/assets/javascripts/module/basics.js on lines 53..63

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

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

      if ($(this).hasClass('collapsed')) {
        $(this)
          .removeClass('collapsed')
          .parents('fieldset')
          .find('.content')
Severity: Major
Found in hawk/app/assets/javascripts/module/basics.js and 1 other location - About 1 hr to fix
hawk/app/assets/javascripts/module/basics.js on lines 63..73

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

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

  def create
    normalize_params! params[:tag].permit!
    @title = _("Create Tag")

    @tag = Tag.new params[:tag].permit!
Severity: Major
Found in hawk/app/controllers/tags_controller.rb and 1 other location - About 1 hr to fix
hawk/app/controllers/tickets_controller.rb on lines 41..64

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

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

  def create
    normalize_params! params[:ticket].permit!
    @title = _("Create Ticket")

    @ticket = Ticket.new params[:ticket].permit!
Severity: Major
Found in hawk/app/controllers/tickets_controller.rb and 1 other location - About 1 hr to fix
hawk/app/controllers/tags_controller.rb on lines 28..51

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

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