opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

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

        db.create_table('cabotapp_service_users_to_notify', (
            ('id', models.AutoField(verbose_name='ID',
             primary_key=True, auto_created=True)),
            ('service',
             models.ForeignKey(orm['cabotapp.service'], null=False)),
Severity: Major
Found in cabot/cabotapp/migrations/0001_initial.py and 4 other locations - About 3 hrs to fix
cabot/cabotapp/migrations/0001_initial.py on lines 50..56
cabot/cabotapp/migrations/0005_auto__add_instance.py on lines 29..32
cabot/cabotapp/migrations/0005_auto__add_instance.py on lines 37..40
cabot/cabotapp/migrations/0005_auto__add_instance.py on lines 45..48

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

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

        db.create_table('cabotapp_service_status_checks', (
            ('id', models.AutoField(verbose_name='ID',
             primary_key=True, auto_created=True)),
            ('service',
             models.ForeignKey(orm['cabotapp.service'], null=False)),
Severity: Major
Found in cabot/cabotapp/migrations/0001_initial.py and 4 other locations - About 3 hrs to fix
cabot/cabotapp/migrations/0001_initial.py on lines 39..44
cabot/cabotapp/migrations/0005_auto__add_instance.py on lines 29..32
cabot/cabotapp/migrations/0005_auto__add_instance.py on lines 37..40
cabot/cabotapp/migrations/0005_auto__add_instance.py on lines 45..48

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

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

        db.create_table(m2m_table_name, (
            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
            ('instance', models.ForeignKey(orm[u'cabotapp.instance'], null=False)),
            ('alertplugin', models.ForeignKey(orm[u'cabotapp.alertplugin'], null=False))
cabot/cabotapp/migrations/0009_auto__add_alertpluginuserdata__add_alertplugin__del_field_instance_tel.py on lines 43..46

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

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

        try:
            twilio_phone_alert = orm['cabot_alert_twilio.TwilioPhoneCall'].objects.get(title="Twilio Phone Call")
        except:
            twilio_phone_alert = orm['cabot_alert_twilio.TwilioPhoneCall'](
                title = "Twilio Phone Call",
Severity: Major
Found in cabot/cabotapp/migrations/0010_plugin_data_migration.py and 3 other locations - About 3 hrs to fix
cabot/cabotapp/migrations/0010_plugin_data_migration.py on lines 23..30
cabot/cabotapp/migrations/0010_plugin_data_migration.py on lines 41..48
cabot/cabotapp/migrations/0010_plugin_data_migration.py on lines 49..56

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

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

    this.fnDestroy = function ( bRemove )
    {
      var oSettings = _fnSettingsFromNode( this[DataTable.ext.iApiIndex] );
      var nOrig = oSettings.nTableWrapper.parentNode;
      var nBody = oSettings.nTBody;
Severity: Major
Found in cabot/static/theme/js/jquery.dataTables.min.js - About 3 hrs to fix

    Function tree has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function tree(d, i) {
          var nodes = hierarchy.call(this, d, i), root = nodes[0];
          function firstWalk(node, previousSibling) {
            var children = node.children, layout = node._tree;
            if (children && (n = children.length)) {
    Severity: Major
    Found in cabot/static/arachnys/js/d3.js - About 3 hrs to fix

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

            for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
              goal = _ref[i];
              color = this.options.goalLineColors[i % this.options.goalLineColors.length];
              _results.push(this.drawGoal(goal, color));
            }
      Severity: Major
      Found in cabot/static/arachnys/js/morris.js and 1 other location - About 3 hrs to fix
      cabot/static/arachnys/js/morris.js on lines 487..491

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

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

          el.animate( animation, {
              queue: false,
              duration: o.duration,
              easing: o.easing,
              complete: function() {
      Severity: Major
      Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
      cabot/static/theme/js/jquery-ui.js on lines 11368..11380

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

      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

            for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
              event = _ref[i];
              color = this.options.eventLineColors[i % this.options.eventLineColors.length];
              _results.push(this.drawEvent(event, color));
            }
      Severity: Major
      Found in cabot/static/arachnys/js/morris.js and 1 other location - About 3 hrs to fix
      cabot/static/arachnys/js/morris.js on lines 475..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 106.

      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

                  ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left - this.margins.right,
      Severity: Major
      Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
      cabot/static/theme/js/jquery-ui.js on lines 1405..1405

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

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

          el.animate( animation, {
              queue: false,
              duration: o.duration,
              easing: o.easing,
              complete: function() {
      Severity: Major
      Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
      cabot/static/theme/js/jquery-ui.js on lines 10692..10704

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

      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

                  ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top  - this.margins.bottom
      Severity: Major
      Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
      cabot/static/theme/js/jquery-ui.js on lines 1404..1404

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

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

      Rickshaw.Graph.Behavior.Series.Toggle = function(args) {
      
        this.graph = args.graph;
        this.legend = args.legend;
      
      
      Severity: Major
      Found in cabot/static/arachnys/js/rickshaw.js - About 3 hrs to fix

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

                    top: (
                        pageY -                                                                // The absolute mouse position
                        this.offset.click.top -                                                    // Click offset (relative to the element)
                        this.offset.relative.top    -                                            // Only for relative positioned nodes: Relative offset from element to offset parent
                        this.offset.parent.top +                                                // The offsetParent's offset without borders (offset + border)
        Severity: Major
        Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
        cabot/static/theme/js/jquery-ui.js on lines 4615..4621

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

        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

                    left: (
                        pageX -                                                                // The absolute mouse position
                        this.offset.click.left -                                                // Click offset (relative to the element)
                        this.offset.relative.left    -                                            // Only for relative positioned nodes: Relative offset from element to offset parent
                        this.offset.parent.left +                                                // The offsetParent's offset without borders (offset + border)
        Severity: Major
        Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
        cabot/static/theme/js/jquery-ui.js on lines 4608..4614

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

        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.graph.vis
              .append("svg:g")
              .attr("class", "y_grid")
              .call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize))
              .selectAll('text')
        Severity: Major
        Found in cabot/static/arachnys/js/rickshaw.js and 1 other location - About 3 hrs to fix
        cabot/static/arachnys/js/rickshaw.js on lines 1559..1564

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

        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.graph.vis
              .append("svg:g")
              .attr("class", "x_grid_d3")
              .call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize))
              .selectAll('text')
        Severity: Major
        Found in cabot/static/arachnys/js/rickshaw.js and 1 other location - About 3 hrs to fix
        cabot/static/arachnys/js/rickshaw.js on lines 1697..1702

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

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

          Morris.Area = (function(_super) {
            var areaDefaults;
        
            __extends(Area, _super);
        
        
        Severity: Major
        Found in cabot/static/arachnys/js/morris.js - About 3 hrs to fix

          Function remove has 87 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              remove: function(node) {
                if (node.N) node.N.P = node.P;
                if (node.P) node.P.N = node.N;
                node.N = node.P = null;
                var parent = node.U, sibling, left = node.L, right = node.R, next, red;
          Severity: Major
          Found in cabot/static/arachnys/js/d3.js - About 3 hrs to fix

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

                        left: (
                            pageX -                                                                    // The absolute mouse position
                            this.offset.click.left -                                                // Click offset (relative to the element)
                            this.offset.relative.left -                                                // Only for relative positioned nodes: Relative offset from element to offset parent
                            this.offset.parent.left +                                                // The offsetParent's offset without borders (offset + border)
            Severity: Major
            Found in cabot/static/theme/js/jquery-ui.js and 1 other location - About 3 hrs to fix
            cabot/static/theme/js/jquery-ui.js on lines 1501..1507

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

            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