opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

Identical blocks of code found in 8 locations. Consider refactoring.
Open

        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
cabot/cabotapp/migrations/0001_initial.py on lines 214..228
cabot/cabotapp/migrations/0002_auto__add_field_statuscheck_verify_ssl_certificate.py on lines 36..50
cabot/cabotapp/migrations/0003_auto.py on lines 40..54
cabot/cabotapp/migrations/0004_auto.py on lines 34..48
cabot/cabotapp/migrations/0005_auto__add_instance.py on lines 81..95
cabot/cabotapp/migrations/0006_auto__chg_field_statuscheck_created_by.py on lines 34..48
cabot/cabotapp/migrations/0007_auto__add_instancestatussnapshot.py on lines 44..58

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

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 8 locations. Consider refactoring.
Open

        'auth.user': {
            'Meta': {'object_name': 'User'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
Severity: Major
Found in cabot/cabotapp/migrations/0001_initial.py and 7 other locations - About 1 day to fix
cabot/cabotapp/migrations/0002_auto__add_field_statuscheck_verify_ssl_certificate.py on lines 36..50
cabot/cabotapp/migrations/0003_auto.py on lines 40..54
cabot/cabotapp/migrations/0004_auto.py on lines 34..48
cabot/cabotapp/migrations/0005_auto__add_instance.py on lines 81..95
cabot/cabotapp/migrations/0006_auto__chg_field_statuscheck_created_by.py on lines 34..48
cabot/cabotapp/migrations/0007_auto__add_instancestatussnapshot.py on lines 44..58
cabot/cabotapp/migrations/0008_auto__add_field_statuscheckresult_job_number.py on lines 36..50

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

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

        if (node === parent.L) {
          sibling = parent.R;
          if (sibling.C) {
            sibling.C = false;
            parent.C = true;
Severity: Major
Found in cabot/static/arachnys/js/d3.js and 1 other location - About 1 day to fix
cabot/static/arachnys/js/d3.js on lines 5287..5308

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

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

        } else {
          sibling = parent.L;
          if (sibling.C) {
            sibling.C = false;
            parent.C = true;
Severity: Major
Found in cabot/static/arachnys/js/d3.js and 1 other location - About 1 day to fix
cabot/static/arachnys/js/d3.js on lines 5266..5287

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

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

  d3.behavior.zoom = function() {
    var view = {
      x: 0,
      y: 0,
      k: 1
Severity: Major
Found in cabot/static/arachnys/js/d3.js - About 1 day to fix

    Function setFillAndStroke has 243 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        setFillAndStroke = function (o, params) {
            var node = o.node,
                attrs = o.attrs,
                vis = node.style.visibility;
            node.style.visibility = "hidden";
    Severity: Major
    Found in cabot/static/arachnys/js/raphael.js - About 1 day to fix

      Function ajax has 240 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        ajax: function( url, options ) {
      
          // If url is an object, simulate pre-1.5 signature
          if ( typeof url === "object" ) {
            options = url;
      Severity: Major
      Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 day to fix

        Function Graph has 220 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Rickshaw.Graph = function(args) {
        
          var self = this;
        
          this.initialize = function(args) {
        Severity: Major
        Found in cabot/static/arachnys/js/rickshaw.js - About 1 day to fix

          Function ClassList has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
          Open

          Rickshaw.Compat.ClassList = function() {
          
            /* adapted from http://purl.eligrey.com/github/classList.js/blob/master/classList.js */
          
            if (typeof document !== "undefined" && !("classList" in document.createElement("a"))) {
          Severity: Minor
          Found in cabot/static/arachnys/js/rickshaw.js - About 1 day 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 d3_locale_timeFormat has 213 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function d3_locale_timeFormat(locale) {
              var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths;
              function d3_time_format(template) {
                var n = template.length;
                function format(date) {
          Severity: Major
          Found in cabot/static/arachnys/js/d3.js - About 1 day to fix

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

                  } else {
                    if (flush || v > rect.dx) v = rect.dx;
                    while (++i < n) {
                      o = row[i];
                      o.x = x;
            Severity: Major
            Found in cabot/static/arachnys/js/d3.js and 1 other location - About 1 day to fix
            cabot/static/arachnys/js/d3.js on lines 7199..7212

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

            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

                  if (u == rect.dx) {
                    if (flush || v > rect.dy) v = rect.dy;
                    while (++i < n) {
                      o = row[i];
                      o.x = x;
            Severity: Major
            Found in cabot/static/arachnys/js/d3.js and 1 other location - About 1 day to fix
            cabot/static/arachnys/js/d3.js on lines 7212..7225

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

            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

              Tooltip.prototype.enter = function (obj) {
                var self = obj instanceof this.constructor ?
                  obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
            
                clearTimeout(self.timeout)
            Severity: Major
            Found in cabot/static/bootstrap/js/bootstrap.js and 1 other location - About 1 day to fix
            cabot/static/bootstrap/js/bootstrap.js on lines 955..968

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

            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

              Tooltip.prototype.leave = function (obj) {
                var self = obj instanceof this.constructor ?
                  obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type)
            
                clearTimeout(self.timeout)
            Severity: Major
            Found in cabot/static/bootstrap/js/bootstrap.js and 1 other location - About 1 day to fix
            cabot/static/bootstrap/js/bootstrap.js on lines 940..953

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

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

                setFillAndStroke = function (o, params) {
                    // o.paper.canvas.style.display = "none";
                    o.attrs = o.attrs || {};
                    var node = o.node,
                        a = o.attrs,
            Severity: Major
            Found in cabot/static/arachnys/js/raphael.js - About 1 day to fix

              Function force has 207 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                d3.layout.force = function() {
                  var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;
                  function repulse(node) {
                    return function(quad, x1, _, x2) {
                      if (quad.point !== node) {
              Severity: Major
              Found in cabot/static/arachnys/js/d3.js - About 1 day to fix

                Function Bar has 206 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  Morris.Bar = (function(_super) {
                
                    __extends(Bar, _super);
                
                    function Bar(options) {
                Severity: Major
                Found in cabot/static/arachnys/js/morris.js - About 1 day to fix

                  Function setDocument has 200 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  setDocument = Sizzle.setDocument = function( node ) {
                    var doc = node ? node.ownerDocument || node : preferredDoc,
                      parent = doc.defaultView;
                  
                    // If no document and documentElement is available, return
                  Severity: Major
                  Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 1 day to fix

                    Function _create has 197 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _create: function() {
                            // Some browsers only repeat keydown events, not keypress events,
                            // so we use the suppressKeyPress flag to determine if we've already
                            // handled the keydown event. #7269
                            // Unfortunately the code for & in keypress is the same as the up arrow,
                    Severity: Major
                    Found in cabot/static/theme/js/jquery.ui.autocomplete.js - About 7 hrs to fix

                      Function _create has 197 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _create: function() {
                              // Some browsers only repeat keydown events, not keypress events,
                              // so we use the suppressKeyPress flag to determine if we've already
                              // handled the keydown event. #7269
                              // Unfortunately the code for & in keypress is the same as the up arrow,
                      Severity: Major
                      Found in cabot/static/theme/js/jquery-ui.js - About 7 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language