maestrano/mno-enterprise

View on GitHub

Showing 153 of 305 total issues

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

angular.module("template/carousel/slide.html", []).run(["$templateCache", function($templateCache) {
  $templateCache.put("template/carousel/slide.html",
    "<div ng-class=\"{\n" +
    "    'active': active\n" +
    "  }\" class=\"item text-center\" ng-transclude></div>\n" +
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 5750..5756
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 5767..5773

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

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 ($attrs.hourStep) {
    $scope.$parent.$watch($parse($attrs.hourStep), function(value) {
      hourStep = parseInt(value, 10);
    });
  }
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 4504..4508

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

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 ($attrs.minuteStep) {
    $scope.$parent.$watch($parse($attrs.minuteStep), function(value) {
      minuteStep = parseInt(value, 10);
    });
  }
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 4497..4501

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

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

          years[i] = angular.extend(ctrl.createDateObject(date, ctrl.formatYear), {
            uid: scope.uniqueId + '-' + i
          });
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 1511..1513

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

          months[i] = angular.extend(ctrl.createDateObject(date, ctrl.formatMonth), {
            uid: scope.uniqueId + '-' + i
          });
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 1573..1575

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

        this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))
frontend/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tooltip.js on lines 66..66

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

        this.$element.on(eventIn  + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
frontend/app/assets/javascripts/mno_enterprise/twitter/bootstrap/tooltip.js on lines 67..67

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

    can :destroy_impac_widgets, MnoEnterprise::Impac::Widget do |w|
      orgs = w.organizations(orgs_with_acl)
      orgs.present? && orgs.all? do |org|
        org.acl[:related] && org.acl[:related][:widgets] && org.acl[:related][:widgets][:destroy]
      end
Severity: Major
Found in core/lib/mno_enterprise/concerns/models/ability.rb and 8 other locations - About 45 mins to fix
core/lib/mno_enterprise/concerns/models/ability.rb on lines 109..114
core/lib/mno_enterprise/concerns/models/ability.rb on lines 116..121
core/lib/mno_enterprise/concerns/models/ability.rb on lines 123..128
core/lib/mno_enterprise/concerns/models/ability.rb on lines 130..135
core/lib/mno_enterprise/concerns/models/ability.rb on lines 137..142
core/lib/mno_enterprise/concerns/models/ability.rb on lines 151..156
core/lib/mno_enterprise/concerns/models/ability.rb on lines 158..163
core/lib/mno_enterprise/concerns/models/ability.rb on lines 165..170

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

    can :destroy_impac_kpis, MnoEnterprise::Impac::Kpi do |k|
      orgs = k.organizations(orgs_with_acl)
      orgs.present? && orgs.all? do |org|
        org.acl[:related] && org.acl[:related][:kpis] && org.acl[:related][:kpis][:destroy]
      end
Severity: Major
Found in core/lib/mno_enterprise/concerns/models/ability.rb and 8 other locations - About 45 mins to fix
core/lib/mno_enterprise/concerns/models/ability.rb on lines 109..114
core/lib/mno_enterprise/concerns/models/ability.rb on lines 116..121
core/lib/mno_enterprise/concerns/models/ability.rb on lines 123..128
core/lib/mno_enterprise/concerns/models/ability.rb on lines 130..135
core/lib/mno_enterprise/concerns/models/ability.rb on lines 137..142
core/lib/mno_enterprise/concerns/models/ability.rb on lines 144..149
core/lib/mno_enterprise/concerns/models/ability.rb on lines 151..156
core/lib/mno_enterprise/concerns/models/ability.rb on lines 158..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 9 locations. Consider refactoring.
Open

    can :create_impac_dashboards, MnoEnterprise::Impac::Dashboard do |d|
      orgs = d.organizations(orgs_with_acl)
      orgs.present? && orgs.all? do |org|
        org.acl[:related] && org.acl[:related][:dashboards] && org.acl[:related][:dashboards][:create]
      end
Severity: Major
Found in core/lib/mno_enterprise/concerns/models/ability.rb and 8 other locations - About 45 mins to fix
core/lib/mno_enterprise/concerns/models/ability.rb on lines 116..121
core/lib/mno_enterprise/concerns/models/ability.rb on lines 123..128
core/lib/mno_enterprise/concerns/models/ability.rb on lines 130..135
core/lib/mno_enterprise/concerns/models/ability.rb on lines 137..142
core/lib/mno_enterprise/concerns/models/ability.rb on lines 144..149
core/lib/mno_enterprise/concerns/models/ability.rb on lines 151..156
core/lib/mno_enterprise/concerns/models/ability.rb on lines 158..163
core/lib/mno_enterprise/concerns/models/ability.rb on lines 165..170

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

    can :destroy_impac_dashboards, MnoEnterprise::Impac::Dashboard do |d|
      orgs = d.organizations(orgs_with_acl)
      orgs.present? && orgs.all? do |org|
        org.acl[:related] && org.acl[:related][:dashboards] && org.acl[:related][:dashboards][:destroy]
      end
Severity: Major
Found in core/lib/mno_enterprise/concerns/models/ability.rb and 8 other locations - About 45 mins to fix
core/lib/mno_enterprise/concerns/models/ability.rb on lines 109..114
core/lib/mno_enterprise/concerns/models/ability.rb on lines 116..121
core/lib/mno_enterprise/concerns/models/ability.rb on lines 130..135
core/lib/mno_enterprise/concerns/models/ability.rb on lines 137..142
core/lib/mno_enterprise/concerns/models/ability.rb on lines 144..149
core/lib/mno_enterprise/concerns/models/ability.rb on lines 151..156
core/lib/mno_enterprise/concerns/models/ability.rb on lines 158..163
core/lib/mno_enterprise/concerns/models/ability.rb on lines 165..170

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

    can :update_impac_dashboards, MnoEnterprise::Impac::Dashboard do |d|
      orgs = d.organizations(orgs_with_acl)
      orgs.present? && orgs.all? do |org|
        org.acl[:related] && org.acl[:related][:dashboards] && org.acl[:related][:dashboards][:update]
      end
Severity: Major
Found in core/lib/mno_enterprise/concerns/models/ability.rb and 8 other locations - About 45 mins to fix
core/lib/mno_enterprise/concerns/models/ability.rb on lines 109..114
core/lib/mno_enterprise/concerns/models/ability.rb on lines 123..128
core/lib/mno_enterprise/concerns/models/ability.rb on lines 130..135
core/lib/mno_enterprise/concerns/models/ability.rb on lines 137..142
core/lib/mno_enterprise/concerns/models/ability.rb on lines 144..149
core/lib/mno_enterprise/concerns/models/ability.rb on lines 151..156
core/lib/mno_enterprise/concerns/models/ability.rb on lines 158..163
core/lib/mno_enterprise/concerns/models/ability.rb on lines 165..170

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

    can :create_impac_widgets, MnoEnterprise::Impac::Widget do |w|
      orgs = w.organizations(orgs_with_acl)
      orgs.present? && orgs.all? do |org|
        org.acl[:related] && org.acl[:related][:widgets] && org.acl[:related][:widgets][:create]
      end
Severity: Major
Found in core/lib/mno_enterprise/concerns/models/ability.rb and 8 other locations - About 45 mins to fix
core/lib/mno_enterprise/concerns/models/ability.rb on lines 109..114
core/lib/mno_enterprise/concerns/models/ability.rb on lines 116..121
core/lib/mno_enterprise/concerns/models/ability.rb on lines 123..128
core/lib/mno_enterprise/concerns/models/ability.rb on lines 137..142
core/lib/mno_enterprise/concerns/models/ability.rb on lines 144..149
core/lib/mno_enterprise/concerns/models/ability.rb on lines 151..156
core/lib/mno_enterprise/concerns/models/ability.rb on lines 158..163
core/lib/mno_enterprise/concerns/models/ability.rb on lines 165..170

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

    can :update_impac_widgets, MnoEnterprise::Impac::Widget do |w|
      orgs = w.organizations(orgs_with_acl)
      orgs.present? && orgs.all? do |org|
        org.acl[:related] && org.acl[:related][:widgets] && org.acl[:related][:widgets][:update]
      end
Severity: Major
Found in core/lib/mno_enterprise/concerns/models/ability.rb and 8 other locations - About 45 mins to fix
core/lib/mno_enterprise/concerns/models/ability.rb on lines 109..114
core/lib/mno_enterprise/concerns/models/ability.rb on lines 116..121
core/lib/mno_enterprise/concerns/models/ability.rb on lines 123..128
core/lib/mno_enterprise/concerns/models/ability.rb on lines 130..135
core/lib/mno_enterprise/concerns/models/ability.rb on lines 144..149
core/lib/mno_enterprise/concerns/models/ability.rb on lines 151..156
core/lib/mno_enterprise/concerns/models/ability.rb on lines 158..163
core/lib/mno_enterprise/concerns/models/ability.rb on lines 165..170

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

    can :update_impac_kpis, MnoEnterprise::Impac::Kpi do |k|
      orgs = k.organizations(orgs_with_acl)
      orgs.present? && orgs.all? do |org|
        org.acl[:related] && org.acl[:related][:kpis] && org.acl[:related][:kpis][:update]
      end
Severity: Major
Found in core/lib/mno_enterprise/concerns/models/ability.rb and 8 other locations - About 45 mins to fix
core/lib/mno_enterprise/concerns/models/ability.rb on lines 109..114
core/lib/mno_enterprise/concerns/models/ability.rb on lines 116..121
core/lib/mno_enterprise/concerns/models/ability.rb on lines 123..128
core/lib/mno_enterprise/concerns/models/ability.rb on lines 130..135
core/lib/mno_enterprise/concerns/models/ability.rb on lines 137..142
core/lib/mno_enterprise/concerns/models/ability.rb on lines 144..149
core/lib/mno_enterprise/concerns/models/ability.rb on lines 151..156
core/lib/mno_enterprise/concerns/models/ability.rb on lines 165..170

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

    can :create_impac_kpis, MnoEnterprise::Impac::Kpi do |k|
      orgs = k.organizations(orgs_with_acl)
      orgs.present? && orgs.all? do |org|
        org.acl[:related] && org.acl[:related][:kpis] && org.acl[:related][:kpis][:create]
      end
Severity: Major
Found in core/lib/mno_enterprise/concerns/models/ability.rb and 8 other locations - About 45 mins to fix
core/lib/mno_enterprise/concerns/models/ability.rb on lines 109..114
core/lib/mno_enterprise/concerns/models/ability.rb on lines 116..121
core/lib/mno_enterprise/concerns/models/ability.rb on lines 123..128
core/lib/mno_enterprise/concerns/models/ability.rb on lines 130..135
core/lib/mno_enterprise/concerns/models/ability.rb on lines 137..142
core/lib/mno_enterprise/concerns/models/ability.rb on lines 144..149
core/lib/mno_enterprise/concerns/models/ability.rb on lines 158..163
core/lib/mno_enterprise/concerns/models/ability.rb on lines 165..170

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

    def destroy
      return render json: { errors: { message: 'Dashboard template not found' } }, status: :not_found unless dashboard_template

      # Abort on failure
      unless dashboard_template.destroy
api/app/controllers/mno_enterprise/jpi/v1/admin/impac/dashboards_controller.rb on lines 49..59

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

    def destroy
      return render json: { errors: { message: 'Dashboard not found' } }, status: :not_found unless dashboard

      # Abort on failure
      unless dashboard.destroy
api/app/controllers/mno_enterprise/jpi/v1/admin/impac/dashboard_templates_controller.rb on lines 57..67

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

              if (!angular.isNumber(dropdownCtrl.selectedOption)) {
                dropdownCtrl.selectedOption = 0;
              } else {
                dropdownCtrl.selectedOption = dropdownCtrl.selectedOption === elems.length -1 ?
                  dropdownCtrl.selectedOption : dropdownCtrl.selectedOption + 1;
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 2091..2097

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

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

  $scope.showSpinners = angular.isDefined($attrs.showSpinners) ?
    $scope.$parent.$eval($attrs.showSpinners) : timepickerConfig.showSpinners;
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 1652..1652
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 3143..3143
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 3144..3144
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 3255..3255
frontend/app/assets/javascripts/mno_enterprise/lib/ui-bootstrap-tpls-0.13.4.js on lines 4492..4492

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

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