opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

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

            target.drawLine(
                Math.round((lwhisker - minValue) * unitSize + canvasLeft),
                Math.round(canvasHeight / 4),
                Math.round((lwhisker - minValue) * unitSize + canvasLeft),
                Math.round(canvasHeight - canvasHeight / 4),
Severity: Major
Found in cabot/static/theme/js/jquery.sparkline.min.js and 1 other location - About 3 hrs to fix
cabot/static/theme/js/jquery.sparkline.min.js on lines 2517..2522

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

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

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

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

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

Refactorings

Further Reading

Function _keydown has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _keydown: function( event ) {
        /*jshint maxcomplexity:20*/
        var match, prev, character, skip, regex,
            preventDefault = true;

Severity: Major
Found in cabot/static/theme/js/jquery-ui.js - About 3 hrs to fix

    Function DonutSegment has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      Morris.DonutSegment = (function(_super) {
    
        __extends(DonutSegment, _super);
    
        function DonutSegment(cx, cy, inner, outer, p0, p1, color, backgroundColor, index, raphael) {
    Severity: Major
    Found in cabot/static/arachnys/js/morris.js - About 3 hrs to fix

      Function addGradientFill has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          addGradientFill = function (element, gradient) {
              var type = "linear",
                  id = element.id + gradient,
                  fx = .5, fy = .5,
                  o = element.node,
      Severity: Major
      Found in cabot/static/arachnys/js/raphael.js - About 3 hrs to fix

        Function data has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          d3_selectionPrototype.data = function(value, key) {
            var i = -1, n = this.length, group, node;
            if (!arguments.length) {
              value = new Array(n = (group = this[0]).length);
              while (++i < n) {
        Severity: Major
        Found in cabot/static/arachnys/js/d3.js - About 3 hrs to fix

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

                  if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
                      po = { top: 0, left: 0 };
                  }
          Severity: Major
          Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
          cabot/static/theme/js/jquery-ui.js on lines 1311..1314

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

          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.offsetParent[0] === document.body) ||
                      (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
                      po = { top: 0, left: 0 };
                  }
          Severity: Major
          Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
          cabot/static/theme/js/jquery-ui.js on lines 4463..4465

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

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

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

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

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

          Refactorings

          Further Reading

          Function formatDate has 79 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              formatDate: function (format, date, settings) {
                  if (!date) {
                      return "";
                  }
          
          
          Severity: Major
          Found in cabot/static/theme/js/jquery-ui.js - About 3 hrs to fix

            Function fnUpdate has 79 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  "fnUpdate": function ( oSettings, fnCallbackDraw )
                  {
                    if ( !oSettings.aanFeatures.p )
                    {
                      return;
            Severity: Major
            Found in cabot/static/theme/js/jquery.dataTables.min.js - About 3 hrs to fix

              Function X has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Rickshaw.Graph.Axis.X = function(args) {
              
                var self = this;
                var berthRate = 0.10;
              
              
              Severity: Major
              Found in cabot/static/arachnys/js/rickshaw.js - About 3 hrs to fix

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

                    function d3_time_parseMonth(date, string, i) {
                      d3_time_monthRe.lastIndex = 0;
                      var n = d3_time_monthRe.exec(string.substring(i));
                      return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
                    }
                Severity: Major
                Found in cabot/static/arachnys/js/d3.js and 3 other locations - About 3 hrs to fix
                cabot/static/arachnys/js/d3.js on lines 2602..2606
                cabot/static/arachnys/js/d3.js on lines 2607..2611
                cabot/static/arachnys/js/d3.js on lines 2612..2616

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

                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

                    function d3_time_parseWeekdayAbbrev(date, string, i) {
                      d3_time_dayAbbrevRe.lastIndex = 0;
                      var n = d3_time_dayAbbrevRe.exec(string.substring(i));
                      return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
                    }
                Severity: Major
                Found in cabot/static/arachnys/js/d3.js and 3 other locations - About 3 hrs to fix
                cabot/static/arachnys/js/d3.js on lines 2607..2611
                cabot/static/arachnys/js/d3.js on lines 2612..2616
                cabot/static/arachnys/js/d3.js on lines 2617..2621

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

                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

                    function d3_time_parseWeekday(date, string, i) {
                      d3_time_dayRe.lastIndex = 0;
                      var n = d3_time_dayRe.exec(string.substring(i));
                      return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
                    }
                Severity: Major
                Found in cabot/static/arachnys/js/d3.js and 3 other locations - About 3 hrs to fix
                cabot/static/arachnys/js/d3.js on lines 2602..2606
                cabot/static/arachnys/js/d3.js on lines 2612..2616
                cabot/static/arachnys/js/d3.js on lines 2617..2621

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

                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 ( !axis || axis === "x" ) {
                                animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
                            }
                Severity: Major
                Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
                cabot/static/theme/js/jquery-ui.js on lines 3925..3927

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

                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

                    function d3_time_parseMonthAbbrev(date, string, i) {
                      d3_time_monthAbbrevRe.lastIndex = 0;
                      var n = d3_time_monthAbbrevRe.exec(string.substring(i));
                      return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
                    }
                Severity: Major
                Found in cabot/static/arachnys/js/d3.js and 3 other locations - About 3 hrs to fix
                cabot/static/arachnys/js/d3.js on lines 2602..2606
                cabot/static/arachnys/js/d3.js on lines 2607..2611
                cabot/static/arachnys/js/d3.js on lines 2617..2621

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

                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 ( !axis || axis === "y" ) {
                                animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
                            }
                Severity: Major
                Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
                cabot/static/theme/js/jquery-ui.js on lines 3922..3924

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

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

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

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

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

                Refactorings

                Further Reading

                Function fnSetColumnVis has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    this.fnSetColumnVis = function ( iCol, bShow, bRedraw )
                    {
                      var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
                      var i, iLen;
                      var aoColumns = oSettings.aoColumns;
                Severity: Major
                Found in cabot/static/theme/js/jquery.dataTables.min.js - About 3 hrs to fix

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

                                  if (pi[0] == "C") {
                                      bez1 = [x1, y1].concat(pi.slice(1));
                                      x1 = bez1[6];
                                      y1 = bez1[7];
                                  } else {
                  Severity: Major
                  Found in cabot/static/arachnys/js/raphael.js and 1 other location - About 3 hrs to fix
                  cabot/static/arachnys/js/raphael.js on lines 1258..1266

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

                  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 (pj[0] == "C") {
                                              bez2 = [x2, y2].concat(pj.slice(1));
                                              x2 = bez2[6];
                                              y2 = bez2[7];
                                          } else {
                  Severity: Major
                  Found in cabot/static/arachnys/js/raphael.js and 1 other location - About 3 hrs to fix
                  cabot/static/arachnys/js/raphael.js on lines 1243..1251

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

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

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

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

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

                  Refactorings

                  Further Reading

                  Function _registerMouseEvents has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                    _registerMouseEvents: function() {
                  
                      var element = d3.select(this.element);
                  
                      var drag = {
                  Severity: Minor
                  Found in cabot/static/arachnys/js/rickshaw.js - About 3 hrs 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

                  Severity
                  Category
                  Status
                  Source
                  Language