opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

Function d3_geo_clipExtent has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function d3_geo_clipExtent(x0, y0, x1, y1) {
    return function(listener) {
      var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring;
      var clip = {
        point: point,
Severity: Major
Found in cabot/static/arachnys/js/d3.js - About 5 hrs to fix

    Function _fnGatherData has 131 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function _fnGatherData( oSettings )
        {
          var iLoop, i, iLen, j, jLen, jInner,
            nTds, nTrs, nTd, nTr, aLocalData, iThisIndex,
            iRow, iRows, iColumn, iColumns, sNodeName,
    Severity: Major
    Found in cabot/static/theme/js/jquery.dataTables.min.js - About 5 hrs to fix

      Function render has 130 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              render: function () {
                  var target = this.target,
                      values = this.values,
                      vlen = values.length,
                      options = this.options,
      Severity: Major
      Found in cabot/static/theme/js/jquery.sparkline.min.js - About 5 hrs to fix

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

              function next() {
                $active
                  .removeClass('active')
                  .find('> .dropdown-menu > .active')
                  .removeClass('active')
        Severity: Major
        Found in cabot/static/theme/js/bootstrap.js and 1 other location - About 5 hrs to fix
        cabot/static/bootstrap/js/bootstrap.js on lines 1408..1428

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

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

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

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

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

        Refactorings

        Further Reading

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

            function next() {
              $active
                .removeClass('active')
                .find('> .dropdown-menu > .active')
                .removeClass('active')
        Severity: Major
        Found in cabot/static/bootstrap/js/bootstrap.js and 1 other location - About 5 hrs to fix
        cabot/static/theme/js/bootstrap.js on lines 1561..1581

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

        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

            function rotation(λ, φ) {
              var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;
              return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ];
            }
        Severity: Major
        Found in cabot/static/arachnys/js/d3.js and 1 other location - About 5 hrs to fix
        cabot/static/arachnys/js/d3.js on lines 4337..4340

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

        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 (name == null) {
                    var res = {};
                    for (var a in this.attrs) if (this.attrs[has](a)) {
                        res[a] = this.attrs[a];
                    }
        Severity: Major
        Found in cabot/static/arachnys/js/raphael.js and 1 other location - About 5 hrs to fix
        cabot/static/arachnys/js/raphael.js on lines 5444..5452

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

        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 (name == null) {
                    var res = {};
                    for (var a in this.attrs) if (this.attrs[has](a)) {
                        res[a] = this.attrs[a];
                    }
        Severity: Major
        Found in cabot/static/arachnys/js/raphael.js and 1 other location - About 5 hrs to fix
        cabot/static/arachnys/js/raphael.js on lines 4516..4524

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

        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

            rotation.invert = function(λ, φ) {
              var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;
              return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ];
            };
        Severity: Major
        Found in cabot/static/arachnys/js/d3.js and 1 other location - About 5 hrs to fix
        cabot/static/arachnys/js/d3.js on lines 4333..4336

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

        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 Callbacks has 128 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        jQuery.Callbacks = function( options ) {
        
          // Convert options from String-formatted to Object-formatted if needed
          // (we check in cache first)
          options = typeof options === "string" ?
        Severity: Major
        Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 5 hrs to fix

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

                          if (spotRadius && options.get('minSpotColor')) {
                              x = xvalues[$.inArray(this.minyorg, yvalues)];
                              target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
                                  canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.minyorg - this.miny) / rangey))),
                                  spotRadius, undefined,
          Severity: Major
          Found in cabot/static/theme/js/jquery.sparkline.min.js and 1 other location - About 5 hrs to fix
          cabot/static/theme/js/jquery.sparkline.min.js on lines 1685..1691

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

          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 (spotRadius && options.get('maxSpotColor')) {
                              x = xvalues[$.inArray(this.maxyorg, yvalues)];
                              target.drawCircle(canvasLeft + Math.round((x - this.minx) * (canvasWidth / rangex)),
                                  canvasTop + Math.round(canvasHeight - (canvasHeight * ((this.maxyorg - this.miny) / rangey))),
                                  spotRadius, undefined,
          Severity: Major
          Found in cabot/static/theme/js/jquery.sparkline.min.js and 1 other location - About 5 hrs to fix
          cabot/static/theme/js/jquery.sparkline.min.js on lines 1678..1684

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

          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 Toggle has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
          Open

          Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
          
            this.graph = args.graph;
            this.legend = args.legend;
          
          
          Severity: Minor
          Found in cabot/static/arachnys/js/rickshaw.js - About 5 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

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

                  'cabotapp.servicestatussnapshot': {
                      'Meta': {'object_name': 'ServiceStatusSnapshot'},
                      'did_send_alert': ('django.db.models.fields.IntegerField', [], {'default': 'False'}),
                      'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
                      'num_checks_active': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
          cabot/cabotapp/migrations/0001_initial.py on lines 247..256

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

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

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

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

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

          Refactorings

          Further Reading

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

                  'cabotapp.servicestatussnapshot': {
                      'Meta': {'object_name': 'ServiceStatusSnapshot'},
                      'did_send_alert': ('django.db.models.fields.IntegerField', [], {'default': 'False'}),
                      'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
                      'num_checks_active': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
          Severity: Major
          Found in cabot/cabotapp/migrations/0001_initial.py and 1 other location - About 5 hrs to fix
          cabot/cabotapp/migrations/0002_auto__add_field_statuscheck_verify_ssl_certificate.py on lines 69..78

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

          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 bounds has 126 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            d3.geo.bounds = function() {
              var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range;
              var bound = {
                point: point,
                lineStart: lineStart,
          Severity: Major
          Found in cabot/static/arachnys/js/d3.js - About 5 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                  if ( event.pageX == null && original.clientX != null ) {
                    eventDoc = event.target.ownerDocument || document;
                    doc = eventDoc.documentElement;
                    body = eventDoc.body;
            
            
            Severity: Critical
            Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 5 hrs to fix

              Function _fnSort has 123 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _fnSort ( oSettings, bApplyClasses )
                  {
                    var
                      i, iLen, j, jLen, k, kLen,
                      sDataType, nTh,
              Severity: Major
              Found in cabot/static/theme/js/jquery.dataTables.min.js - About 4 hrs to fix

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

                            if ($.isArray(options.get('colorMap'))) {
                                this.colorMapByIndex = options.get('colorMap');
                                this.colorMapByValue = null;
                            } else {
                                this.colorMapByIndex = null;
                Severity: Major
                Found in cabot/static/theme/js/jquery.sparkline.min.js and 1 other location - About 4 hrs to fix
                cabot/static/theme/js/jquery.sparkline.min.js on lines 1974..1983

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

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

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

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

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

                Refactorings

                Further Reading

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

                            if ($.isArray(options.get('colorMap'))) {
                                this.colorMapByIndex = options.get('colorMap');
                                this.colorMapByValue = null;
                            } else {
                                this.colorMapByIndex = null;
                Severity: Major
                Found in cabot/static/theme/js/jquery.sparkline.min.js and 1 other location - About 4 hrs to fix
                cabot/static/theme/js/jquery.sparkline.min.js on lines 1832..1841

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

                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