opsforgeio/cabot

View on GitHub

Showing 840 of 1,637 total issues

Function chord has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  d3.svg.chord = function() {
    var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
    function chord(d, i) {
      var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);
      return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z";
Severity: Minor
Found in cabot/static/arachnys/js/d3.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

            if ( ( mappedTypes || origType === handleObj.origType ) &&
              ( !handler || handler.guid === handleObj.guid ) &&
              ( !tmp || tmp.test( handleObj.namespace ) ) &&
              ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
              handlers.splice( j, 1 );
    Severity: Critical
    Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 2 hrs to fix

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

        render: function(args) {
      
          var graph = this.graph;
          var points = args.points;
          var point = points.filter( function(p) { return p.active } ).shift();
      Severity: Minor
      Found in cabot/static/arachnys/js/rickshaw.js - About 2 hrs to fix

        Function stackData has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          this.stackData = function() {
        
            var data = this.series.active()
              .map( function(d) { return d.data } )
              .map( function(d) { return d.filter( function(d) { return this._slice(d) }, this ) }, this);
        Severity: Minor
        Found in cabot/static/arachnys/js/rickshaw.js - About 2 hrs to fix

          Function _setOption has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _setOption: function( key, value ) {
                  var i,
                      valsLength = 0;
          
                  if ( key === "range" && this.options.range === true ) {
          Severity: Minor
          Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

            Function blind has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            $.effects.effect.blind = function( o, done ) {
                // Create element
                var el = $( this ),
                    props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
                    mode = $.effects.setMode( el, o.mode || "hide" ),
            Severity: Minor
            Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

              Function _setOption has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _setOption: function( key, value ) {
                      /*jshint maxcomplexity:15*/
                      var isDraggable, isResizable,
                          uiDialog = this.uiDialog;
              
              
              Severity: Minor
              Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                Function onMousemove has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function onMousemove(datum, index) {
                
                      drag.stop = self._getClientXFromEvent(d3.event, drag);
                      var distanceTraveled = drag.stop - drag.start;
                      var frameAfterDrag = self.frameBeforeDrag.slice(0);
                Severity: Minor
                Found in cabot/static/arachnys/js/rickshaw.js - About 1 hr to fix

                  Function internalRemoveData has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function internalRemoveData( elem, name, pvt ) {
                    if ( !jQuery.acceptData( elem ) ) {
                      return;
                    }
                  
                  
                  Severity: Minor
                  Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 hr to fix

                    Function _animate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _animate: function( toShow, toHide, data ) {
                            var total, easing, duration,
                                that = this,
                                adjust = 0,
                                down = toShow.length &&
                    Severity: Minor
                    Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                      Function _determineDate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _determineDate: function(inst, date, defaultDate) {
                              var offsetNumeric = function(offset) {
                                      var date = new Date();
                                      date.setDate(date.getDate() + offset);
                                      return date;
                      Severity: Minor
                      Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                        Function _fnAjaxParameters has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function _fnAjaxParameters( oSettings )
                            {
                              var iColumns = oSettings.aoColumns.length;
                              var aoData = [], mDataProp, aaSort, aDataSort;
                              var i, j;
                        Severity: Minor
                        Found in cabot/static/theme/js/jquery.dataTables.min.js - About 1 hr to fix

                          Function _mouseCapture has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              _mouseCapture: function( event ) {
                                  var position, normValue, distance, closestHandle, index, allowed, offset, mouseOverHandle,
                                      that = this,
                                      o = this.options;
                          
                          
                          Severity: Minor
                          Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                            Function _toggle has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                _toggle: function( event, eventData ) {
                                    var that = this,
                                        toShow = eventData.newPanel,
                                        toHide = eventData.oldPanel;
                            
                            
                            Severity: Minor
                            Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                              Function addEvent has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  addEvent = (function () {
                                      if (g.doc.addEventListener) {
                                          return function (obj, type, fn, element) {
                                              var realName = supportsTouch && touchMap[type] ? touchMap[type] : type,
                                                  f = function (e) {
                              Severity: Minor
                              Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

                                Function d3_time_scale has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function d3_time_scale(linear, methods, format) {
                                    function scale(x) {
                                      return linear(x);
                                    }
                                    scale.invert = function(x) {
                                Severity: Minor
                                Found in cabot/static/arachnys/js/d3.js - About 1 hr to fix

                                  Function Highlight has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Rickshaw.Graph.Behavior.Series.Highlight = function(args) {
                                  
                                    this.graph = args.graph;
                                    this.legend = args.legend;
                                  
                                  
                                  Severity: Minor
                                  Found in cabot/static/arachnys/js/rickshaw.js - About 1 hr to fix

                                    Function alert has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        def alert(self):
                                            if not self.alerts_enabled:
                                                return
                                            if self.overall_status != self.PASSING_STATUS:
                                                # Don't alert every time
                                    Severity: Minor
                                    Found in cabot/cabotapp/models.py - About 1 hr 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 resize has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        resize: function() {
                                            var that = $(this).data("ui-resizable"),
                                                o = that.options,
                                                cs = that.size,
                                                os = that.originalSize,
                                    Severity: Minor
                                    Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                                      Function _fnAjaxUpdateDraw has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          function _fnAjaxUpdateDraw ( oSettings, json )
                                          {
                                            if ( json.sEcho !== undefined )
                                            {
                                              /* Protect against old returns over-writing a new one. Possible when you get
                                      Severity: Minor
                                      Found in cabot/static/theme/js/jquery.dataTables.min.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language