opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

Function attr has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    elproto.attr = function (name, value) {
        if (this.removed) {
            return this;
        }
        if (name == null) {
Severity: Major
Found in cabot/static/arachnys/js/raphael.js - About 2 hrs to fix

    Function hierarchy has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      d3.layout.hierarchy = function() {
        var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
        function recurse(node, depth, nodes) {
          var childs = children.call(hierarchy, node, depth);
          node.depth = depth;
    Severity: Major
    Found in cabot/static/arachnys/js/d3.js - About 2 hrs to fix

      Function tick has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          force.tick = function() {
            if ((alpha *= .99) < .005) {
              event.end({
                type: "end",
                alpha: alpha = 0
      Severity: Major
      Found in cabot/static/arachnys/js/d3.js - About 2 hrs to fix

        Function init has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          init: function( selector, context, rootjQuery ) {
            var match, elem;
        
            // HANDLE: $(""), $(null), $(undefined), $(false)
            if ( !selector ) {
        Severity: Major
        Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 2 hrs to fix

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

            $(document)
              .on('click.bs.dropdown.data-api', clearMenus)
              .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
              .on('click.bs.dropdown.data-api'  , toggle, Dropdown.prototype.toggle)
              .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
          Severity: Major
          Found in cabot/static/bootstrap/js/bootstrap.js and 1 other location - About 2 hrs to fix
          cabot/static/theme/js/bootstrap.js on lines 716..720

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

          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

            $(document)
              .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus)
              .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
              .on('click.dropdown.data-api touchstart.dropdown.data-api'  , toggle, Dropdown.prototype.toggle)
              .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
          Severity: Major
          Found in cabot/static/theme/js/bootstrap.js and 1 other location - About 2 hrs to fix
          cabot/static/bootstrap/js/bootstrap.js on lines 581..585

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

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

                  keydown: function( event ) {
                      /*jshint maxcomplexity:25*/
                      var allowed, curVal, newVal, step,
                          index = $( event.target ).data( "ui-slider-handle-index" );
          
          
          Severity: Major
          Found in cabot/static/theme/js/jquery-ui.js - About 2 hrs to fix

            Function d3_geo_clipPolygon has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
                var subject = [], clip = [];
                segments.forEach(function(segment) {
                  if ((n = segment.length - 1) <= 0) return;
                  var n, p0 = segment[0], p1 = segment[n];
            Severity: Major
            Found in cabot/static/arachnys/js/d3.js - About 2 hrs to fix

              File 0010_plugin_data_migration.py has 261 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              from south.utils import datetime_utils as datetime
              from south.db import db
              from south.v2 import DataMigration
              from django.db import models
              Severity: Minor
              Found in cabot/cabotapp/migrations/0010_plugin_data_migration.py - About 2 hrs to fix

                Function fnUpdate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                Open

                        "fnUpdate": function ( oSettings, fnDraw ) {
                            var iListLength = 5;
                            var oPaging = oSettings.oInstance.fnPagingInfo();
                            var an = oSettings.aanFeatures.p;
                            var i, j, sClass, iStart, iEnd, iHalf=Math.floor(iListLength/2);
                Severity: Minor
                Found in cabot/static/theme/js/custom.js - About 2 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

                        if (cx == null || cy == null) {
                            var bbox = this.getBBox(1);
                            cx = bbox.x + bbox.width / 2;
                            cy = bbox.y + bbox.height / 2;
                        }
                Severity: Major
                Found in cabot/static/arachnys/js/raphael.js and 1 other location - About 2 hrs to fix
                cabot/static/arachnys/js/raphael.js on lines 5356..5360

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

                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 (cx == null || cy == null) {
                            var bbox = this.getBBox(1);
                            cx = bbox.x + bbox.width / 2;
                            cy = bbox.y + bbox.height / 2;
                        }
                Severity: Major
                Found in cabot/static/arachnys/js/raphael.js and 1 other location - About 2 hrs to fix
                cabot/static/arachnys/js/raphael.js on lines 4400..4404

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

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

                    createWrapper: function( element ) {
                
                        // if the element is already wrapped, return it
                        if ( element.parent().is( ".ui-effects-wrapper" )) {
                            return element.parent();
                Severity: Major
                Found in cabot/static/theme/js/jquery-ui.js - About 2 hrs to fix

                  Function renderRegion has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          renderRegion: function (valuenum, highlight) {
                              var vals = this.values[valuenum],
                                  options = this.options,
                                  xaxisOffset = this.xaxisOffset,
                                  result = [],
                  Severity: Major
                  Found in cabot/static/theme/js/jquery.sparkline.min.js - About 2 hrs to fix

                    Function fnFilter has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        this.fnFilter = function( sInput, iColumn, bRegex, bSmart, bShowGlobal, bCaseInsensitive )
                        {
                          var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
                    
                          if ( !oSettings.oFeatures.bFilter )
                    Severity: Major
                    Found in cabot/static/theme/js/jquery.dataTables.min.js - About 2 hrs to fix

                      Function _generateMonthYearHeader has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _generateMonthYearHeader: function(inst, drawMonth, drawYear, minDate, maxDate,
                                  secondary, monthNames, monthNamesShort) {
                      
                              var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear,
                                  changeMonth = this._get(inst, "changeMonth"),
                      Severity: Major
                      Found in cabot/static/theme/js/jquery-ui.js - About 2 hrs to fix

                        Function _fnColumnOptions has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function _fnColumnOptions( oSettings, iCol, oOptions )
                            {
                              var oCol = oSettings.aoColumns[ iCol ];
                        
                              /* User specified column options */
                        Severity: Major
                        Found in cabot/static/theme/js/jquery.dataTables.min.js - About 2 hrs to fix

                          Function _fnGetObjectDataFn has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function _fnGetObjectDataFn( mSource )
                              {
                                if ( mSource === null )
                                {
                                  /* Give an empty string for rendering / sorting etc */
                          Severity: Major
                          Found in cabot/static/theme/js/jquery.dataTables.min.js - About 2 hrs to fix

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

                                  this.data = (function() {
                                    var _i, _len, _results;
                                    _results = [];
                                    for (index = _i = 0, _len = data.length; _i < _len; index = ++_i) {
                                      row = data[index];
                            Severity: Major
                            Found in cabot/static/arachnys/js/morris.js - About 2 hrs to fix

                              Function domManip has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                domManip: function( args, callback, allowIntersection ) {
                              
                                  // Flatten any nested arrays
                                  args = core_concat.apply( [], args );
                              
                              
                              Severity: Major
                              Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language