opsforgeio/cabot

View on GitHub

Showing 840 of 1,637 total issues

Function d3_scale_log has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function d3_scale_log(linear, base, positive, domain) {
    function log(x) {
      return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);
    }
    function pow(x) {
Severity: Major
Found in cabot/static/arachnys/js/d3.js - About 2 hrs to fix

    Function CHILD has 59 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        "CHILD": function( type, what, argument, first, last ) {
          var simple = type.slice( 0, 3 ) !== "nth",
            forward = type.slice( -4 ) !== "last",
            ofType = what === "of-type";
    
    
    Severity: Major
    Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 2 hrs to fix

      Function update has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        this.update = function() {
      
          Rickshaw.keys(self.data).forEach( function(time) {
      
            var annotation = self.data[time];
      Severity: Major
      Found in cabot/static/arachnys/js/rickshaw.js - About 2 hrs to fix

        Function Class has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var Class = (function() {
        
          // Some versions of JScript fail to enumerate over properties, names of which
          // correspond to non-enumerable properties in the prototype chain
          var IS_DONTENUM_BUGGY = (function(){
        Severity: Major
        Found in cabot/static/arachnys/js/rickshaw.js - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                      if ( forward && useCache ) {
                        // Seek `elem` from a previously-cached index
                        outerCache = parent[ expando ] || (parent[ expando ] = {});
                        cache = outerCache[ type ] || [];
                        nodeIndex = cache[0] === dirruns && cache[1];
          Severity: Critical
          Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 2 hrs to fix

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

                _generatePosition: function(event) {
            
                    var containment, co, top, left,
                        o = this.options,
                        scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,
            Severity: Major
            Found in cabot/static/theme/js/jquery-ui.js - About 2 hrs to fix

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

                        eve = function (name, scope) {
                            var e = events,
                                oldstop = stop,
                                args = Array.prototype.slice.call(arguments, 2),
                                listeners = eve.listeners(name),
                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

                        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

                              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 _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 _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 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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language