livingsocial/rearview-engine

View on GitHub

Showing 133 of 133 total issues

Method eval has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def eval(data, expr = nil, initial_ns = {}, verbose = false, immediate = false)
        logger.debug "#{self} eval"
        # prepare variable map for the monitor process
        namespace = create_namespace(data, initial_ns)

Severity: Minor
Found in lib/rearview/monitor_runner.rb - About 55 mins 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

Method color has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

      def color
        unless @color
          e = self.expressions.detect {|e| e.identifier.try(:text) == "color" }
          if e && e.args && e.args.elements
            color_val = e.args.elements.last.detect { |e| e.kind_of?(Graphite::TargetGrammer::StringLiteral)  }
Severity: Minor
Found in lib/graphite/target_grammer.rb - About 55 mins 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 2 locations. Consider refactoring.
Open

        header : function() {
            this.auth();
            new HeaderView({
                'el'      : $('.header-wrap'),
                'templar' : this.templar
Severity: Minor
Found in public/rearview-src/js/app.js and 1 other location - About 55 mins to fix
public/rearview-src/js/app.js on lines 118..124

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

        secondaryNav : function() {
            this.auth();
            new SecondaryNavView({
                'el'      : $('.secondary-nav-wrap'),
                'templar' : this.templar
Severity: Minor
Found in public/rearview-src/js/app.js and 1 other location - About 55 mins to fix
public/rearview-src/js/app.js on lines 95..101

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

Method run has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def run(metrics,
              monitor_expr = nil,
              minutes      = nil,
              namespace    = {},
              verbose      = false,
Severity: Major
Found in lib/rearview/monitor_runner.rb - About 50 mins to fix

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

                this.$el.find('.alerts-history ul').css({
                    'height' : ( $(window).height() - windowOffSet - alertsOffset ) + 'px'
                });
    Severity: Minor
    Found in public/rearview-src/js/view/expandedmonitor.js and 1 other location - About 50 mins to fix
    public/rearview-src/js/view/expandedmonitor.js on lines 569..571

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

    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.$el.find('.output-view').css({
                    'height' : ( $(window).height() - windowOffSet - outputOffset ) + 'px'
                });
    Severity: Minor
    Found in public/rearview-src/js/view/expandedmonitor.js and 1 other location - About 50 mins to fix
    public/rearview-src/js/view/expandedmonitor.js on lines 573..575

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

    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.$el.find('.icon-chevron-sign-right').click(function() {
                    this.$carousel.carousel('next');
                }.bind(this));
    Severity: Minor
    Found in public/rearview-src/js/view/dashboard.js and 1 other location - About 50 mins to fix
    public/rearview-src/js/view/dashboard.js on lines 185..187

    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.$el.find('.icon-chevron-sign-left').click(function() {
                    this.$carousel.carousel('prev');
                }.bind(this));
    Severity: Minor
    Found in public/rearview-src/js/view/dashboard.js and 1 other location - About 50 mins to fix
    public/rearview-src/js/view/dashboard.js on lines 181..183

    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

    Avoid deeply nested control flow statements.
    Open

                                if (!_.isNull(timeIndex)) { 
                                    chart.xAxis[0].addPlotLine({
                                        id        : 'plotLine',
                                        value     : timeIndex,
                                        color     : 'green',
    Severity: Major
    Found in public/rearview-src/js/view/base.js - About 45 mins to fix

      Method create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          def create
            @errors = if params[:metrics].empty?
                        [ "No metrics were provided" ]
                      else
                        metrics_validator = Rearview::MetricsValidator.new({attributes: [:metrics]})
      Severity: Minor
      Found in app/controllers/rearview/monitor_controller.rb - About 45 mins 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 2 locations. Consider refactoring.
      Open

                      out : function(e, ui) {
                          $(e.target).removeClass('active-drop');
                          ui.draggable.draggable( 'option', 'revert', true );
                      }, 
      Severity: Minor
      Found in public/rearview-src/js/view/dashboard.js and 1 other location - About 40 mins to fix
      public/rearview-src/js/view/dashboard.js on lines 161..164

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

      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

                  $.ajax({
                      url     : rearview.path + '/help/quick.html',
                      async   : false,
                      success : function( response ) {
                          $quickContent = response;
      Severity: Major
      Found in public/rearview-src/js/view/expandedmonitor.js and 5 other locations - About 40 mins to fix
      public/rearview-src/js/view/addmonitor.js on lines 223..229
      public/rearview-src/js/view/addmonitor.js on lines 231..237
      public/rearview-src/js/view/addmonitor.js on lines 472..478
      public/rearview-src/js/view/expandedmonitor.js on lines 256..262
      public/rearview-src/js/view/expandedmonitor.js on lines 272..278

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

      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

                      over : function(e, ui) {
                          $(e.target).addClass('active-drop');
                          ui.draggable.draggable( 'option', 'revert', false );
                      },
      Severity: Minor
      Found in public/rearview-src/js/view/dashboard.js and 1 other location - About 40 mins to fix
      public/rearview-src/js/view/dashboard.js on lines 165..168

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

      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

                  $.ajax({
                      url     : rearview.path + '/help/cron.html',
                      async   : false,
                      success : function( response ) {
                          $cronHelpContent = response;
      Severity: Major
      Found in public/rearview-src/js/view/addmonitor.js and 5 other locations - About 40 mins to fix
      public/rearview-src/js/view/addmonitor.js on lines 231..237
      public/rearview-src/js/view/addmonitor.js on lines 472..478
      public/rearview-src/js/view/expandedmonitor.js on lines 256..262
      public/rearview-src/js/view/expandedmonitor.js on lines 264..270
      public/rearview-src/js/view/expandedmonitor.js on lines 272..278

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

      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

                  $.ajax({
                      url     : rearview.path + '/help/quick.html',
                      async   : false,
                      success : function( response ) {
                          $content = response;
      Severity: Major
      Found in public/rearview-src/js/view/addmonitor.js and 5 other locations - About 40 mins to fix
      public/rearview-src/js/view/addmonitor.js on lines 223..229
      public/rearview-src/js/view/addmonitor.js on lines 231..237
      public/rearview-src/js/view/expandedmonitor.js on lines 256..262
      public/rearview-src/js/view/expandedmonitor.js on lines 264..270
      public/rearview-src/js/view/expandedmonitor.js on lines 272..278

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

      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

                  $.ajax({
                      url     : rearview.path + '/help/cron.html',
                      async   : false,
                      success : function( response ) {
                          $cronHelpContent = response;
      Severity: Major
      Found in public/rearview-src/js/view/expandedmonitor.js and 5 other locations - About 40 mins to fix
      public/rearview-src/js/view/addmonitor.js on lines 223..229
      public/rearview-src/js/view/addmonitor.js on lines 231..237
      public/rearview-src/js/view/addmonitor.js on lines 472..478
      public/rearview-src/js/view/expandedmonitor.js on lines 264..270
      public/rearview-src/js/view/expandedmonitor.js on lines 272..278

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

      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

                          Backbone.Mediator.pub('view:addcategory:save', {
                              'model'     : model,
                              'message'   : "The category '" + model.get('name') + "' was added.",
                              'attention' : 'Category Saved!'
                          });
      Severity: Minor
      Found in public/rearview-src/js/view/addcategory.js and 2 other locations - About 40 mins to fix
      public/rearview-src/js/view/addcategory.js on lines 209..213
      public/rearview-src/js/view/adddashboard.js on lines 133..137

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

      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

                          Backbone.Mediator.pub('view:adddashboard:save', {
                              'model'     : model,
                              'message'   : "The dashboard '" + model.get('name') + "' was added.",
                              'attention' : 'Dashboard Saved!'
                          });
      Severity: Minor
      Found in public/rearview-src/js/view/adddashboard.js and 2 other locations - About 40 mins to fix
      public/rearview-src/js/view/addcategory.js on lines 158..162
      public/rearview-src/js/view/addcategory.js on lines 209..213

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

      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

                  $.ajax({
                      url     : rearview.path + '/help/alert.html',
                      async   : false,
                      success : function( response ) {
                          $alertContent = response;
      Severity: Major
      Found in public/rearview-src/js/view/expandedmonitor.js and 5 other locations - About 40 mins to fix
      public/rearview-src/js/view/addmonitor.js on lines 223..229
      public/rearview-src/js/view/addmonitor.js on lines 231..237
      public/rearview-src/js/view/addmonitor.js on lines 472..478
      public/rearview-src/js/view/expandedmonitor.js on lines 256..262
      public/rearview-src/js/view/expandedmonitor.js on lines 264..270

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

      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