opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

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

                delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
Severity: Major
Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 1 hr to fix
cabot/static/theme/js/jquery-ui.js on lines 4696..4696

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

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

    this.selector = (this.options.target
      || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7
      || '') + ' .nav li > a'
Severity: Major
Found in cabot/static/theme/js/bootstrap.js and 1 other location - About 1 hr to fix
cabot/static/bootstrap/js/bootstrap.js on lines 1817..1819

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

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

    $.fn[ name ] = function( options ) {
        var isMethodCall = typeof options === "string",
            args = slice.call( arguments, 1 ),
            returnValue = this;

Severity: Minor
Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

    Function updateDisplay has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            updateDisplay: function () {
                var splist = this.splist,
                     spcount = splist.length,
                     needsRefresh = false,
                     offset = this.$canvas.offset(),
    Severity: Minor
    Found in cabot/static/theme/js/jquery.sparkline.min.js - About 1 hr to fix

      Function load has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          load: function( index, event ) {
              index = this._getIndex( index );
              var that = this,
                  tab = this.tabs.eq( index ),
                  anchor = tab.find( ".ui-tabs-anchor" ),
      Severity: Minor
      Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

        Function clip has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        $.effects.effect.clip = 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 print has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              paperproto.print = function (x, y, string, font, size, origin, letter_spacing) {
                  origin = origin || "middle"; // baseline|middle
                  letter_spacing = mmax(mmin(letter_spacing || 0, 1), -1);
                  var letters = Str(string)[split](E),
                      shift = 0,
          Severity: Minor
          Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

            Function autoGridLines has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Grid.prototype.autoGridLines = function(ymin, ymax, nlines) {
                  var gmax, gmin, grid, smag, span, step, unit, y, ymag;
                  span = ymax - ymin;
                  ymag = Math.floor(Math.log(span) / Math.log(10));
                  unit = Math.pow(10, ymag);
            Severity: Minor
            Found in cabot/static/arachnys/js/morris.js - About 1 hr to fix

              Function when has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                when: function( subordinate /* , ..., subordinateN */ ) {
                  var i = 0,
                    resolveValues = core_slice.call( arguments ),
                    length = resolveValues.length,
              
              
              Severity: Minor
              Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 hr to fix

                Function Palette has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                Rickshaw.Color.Palette = function(args) {
                
                  var color = new Rickshaw.Fixtures.Color();
                
                  args = args || {};
                Severity: Minor
                Found in cabot/static/arachnys/js/rickshaw.js - 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

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

                class InstanceStatusSnapshot(Snapshot):
                    instance = models.ForeignKey(Instance, related_name='snapshots')
                
                    def __unicode__(self):
                        return u"%s: %s" % (self.instance.name, self.overall_status)
                Severity: Major
                Found in cabot/cabotapp/models.py and 1 other location - About 1 hr to fix
                cabot/cabotapp/models.py on lines 360..364

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

                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

                class ServiceStatusSnapshot(Snapshot):
                    service = models.ForeignKey(Service, related_name='snapshots')
                
                    def __unicode__(self):
                        return u"%s: %s" % (self.service.name, self.overall_status)
                Severity: Major
                Found in cabot/cabotapp/models.py and 1 other location - About 1 hr to fix
                cabot/cabotapp/models.py on lines 367..371

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

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

                    _resetButton: function() {
                        if ( this.type === "input" ) {
                            if ( this.options.label ) {
                                this.element.val( this.options.label );
                            }
                Severity: Minor
                Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

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

                      _mouseCapture: function(event, overrideHandle) {
                          var currentItem = null,
                              validHandle = false,
                              that = this;
                  
                  
                  Severity: Minor
                  Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

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

                        _toggle: function( data ) {
                            var toShow = data.newPanel,
                                toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
                    
                            // handle activating a panel during the animation for another activation
                    Severity: Minor
                    Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                      Function _dialogDatepicker has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _dialogDatepicker: function(input, date, onSelect, settings, pos) {
                              var id, browserWidth, browserHeight, scrollX, scrollY,
                                  inst = this._dialogInst; // internal instance
                      
                              if (!inst) {
                      Severity: Minor
                      Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                        Function _hideDatepicker has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _hideDatepicker: function(input) {
                                var showAnim, duration, postProcess, onClose,
                                    inst = this._curInst;
                        
                                if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
                        Severity: Minor
                        Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                          Function drag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              drag: function( event ) {
                          
                                  var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;
                          
                                  if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
                          Severity: Minor
                          Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                            Function cancel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                cancel: function() {
                            
                                    if(this.dragging) {
                            
                                        this._mouseUp({ target: null });
                            Severity: Minor
                            Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                              Function effect has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  effect: function( /* effect, options, speed, callback */ ) {
                                      var args = _normalizeArguments.apply( this, arguments ),
                                          mode = args.mode,
                                          queue = args.queue,
                                          effectMethod = $.effects.effect[ args.effect ];
                              Severity: Minor
                              Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language