opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

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

class JenkinsCheckUpdateView(CheckUpdateView):
    model = JenkinsStatusCheck
    form_class = JenkinsStatusCheckForm

    def form_valid(self, form):
Severity: Major
Found in cabot/cabotapp/views.py and 1 other location - About 1 hr to fix
cabot/cabotapp/views.py on lines 473..479

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

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

            hipchat_alias = orm['cabot_alert_hipchat.hipchatalertuserdata'](
                title = "Hipchat Plugin",
                hipchat_alias = profile.hipchat_alias,
                polymorphic_ctype = orm['contenttypes.contenttype'].objects.get(model='hipchatalertuserdata'),
Severity: Major
Found in cabot/cabotapp/migrations/0010_plugin_data_migration.py and 1 other location - About 1 hr to fix
cabot/cabotapp/migrations/0010_plugin_data_migration.py on lines 84..87

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

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 JenkinsCheckCreateView(CheckCreateView):
    model = JenkinsStatusCheck
    form_class = JenkinsStatusCheckForm

    def form_valid(self, form):
Severity: Major
Found in cabot/cabotapp/views.py and 1 other location - About 1 hr to fix
cabot/cabotapp/views.py on lines 482..488

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

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

  , slide: function (type, next) {
      var $active = this.$element.find('.item.active')
        , $next = next || $active[type]()
        , isCycling = this.interval
        , direction = type == 'next' ? 'left' : 'right'
Severity: Minor
Found in cabot/static/theme/js/bootstrap.js - About 1 hr to fix

    Function _respectSize has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _respectSize: function( data ) {
    
            var o = this._vBoundaries,
                a = this.axis,
                ismaxw = isNumber(data.width) && o.maxWidth && (o.maxWidth < data.width), ismaxh = isNumber(data.height) && o.maxHeight && (o.maxHeight < data.height),
    Severity: Minor
    Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

      Function _mouseDown has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _mouseDown: function(event) {
              // don't let more than one widget handle mouseStart
              if( mouseHandled ) { return; }
      
              // we may have missed mouseup (out of window)
      Severity: Minor
      Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

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

            drag: function(draggable, event) {
        
                //If you have a highly dynamic page, you might try this option. It renders positions every time you move the mouse.
                if(draggable.options.refreshPositions) {
                    $.ui.ddmanager.prepareOffsets(draggable, event);
        Severity: Minor
        Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

          Function _createPlaceholder has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _createPlaceholder: function(that) {
                  that = that || this;
                  var className,
                      o = that.options;
          
          
          Severity: Minor
          Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

            Function drop has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            $.effects.effect.drop = function( o, done ) {
            
                var el = $( this ),
                    props = [ "position", "top", "bottom", "left", "right", "opacity", "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 _possibleChars has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _possibleChars: function (format) {
                      var iFormat,
                          chars = "",
                          literal = false,
                          // Check whether a format character is doubled
              Severity: Minor
              Found in cabot/static/theme/js/jquery-ui.js - About 1 hr to fix

                Function parsePathString has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    R.parsePathString = function (pathString) {
                        if (!pathString) {
                            return null;
                        }
                        var pth = paths(pathString);
                Severity: Minor
                Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

                  Function registerFont has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      R.registerFont = function (font) {
                          if (!font.face) {
                              return font;
                          }
                          this.fonts = this.fonts || {};
                  Severity: Minor
                  Found in cabot/static/arachnys/js/raphael.js - About 1 hr to fix

                    Function d3_geo_clipAntimeridianLine has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function d3_geo_clipAntimeridianLine(listener) {
                        var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;
                        return {
                          lineStart: function() {
                            listener.lineStart();
                    Severity: Minor
                    Found in cabot/static/arachnys/js/d3.js - About 1 hr to fix

                      Function Palette has 37 lines of code (exceeds 25 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

                        Function showHide has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function showHide( elements, show ) {
                          var display, elem, hidden,
                            values = [],
                            index = 0,
                            length = elements.length;
                        Severity: Minor
                        Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 hr to fix

                          Function ajaxHandleResponses has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function ajaxHandleResponses( s, jqXHR, responses ) {
                            var firstDataType, ct, finalDataType, type,
                              contents = s.contents,
                              dataTypes = s.dataTypes;
                          
                          
                          Severity: Minor
                          Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 hr to fix

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

                                stack.order = function(x) {
                                  if (!arguments.length) return order;
                                  order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault;
                                  return stack;
                                };
                            Severity: Major
                            Found in cabot/static/arachnys/js/d3.js and 1 other location - About 1 hr to fix
                            cabot/static/arachnys/js/d3.js on lines 6564..6568

                            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

                                stack.offset = function(x) {
                                  if (!arguments.length) return offset;
                                  offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero;
                                  return stack;
                                };
                            Severity: Major
                            Found in cabot/static/arachnys/js/d3.js and 1 other location - About 1 hr to fix
                            cabot/static/arachnys/js/d3.js on lines 6559..6563

                            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/bootstrap/js/bootstrap.js and 1 other location - About 1 hr to fix
                            cabot/static/theme/js/bootstrap.js on lines 1367..1369

                            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

                                            delayedTriggers.push((function(c) { return function(event) { c._trigger("out", 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 4693..4693

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language