opsforgeio/cabot

View on GitHub

Showing 1,637 of 1,637 total issues

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

  function d3_time_parseWeekdayNumber(date, string, i) {
    d3_time_numberRe.lastIndex = 0;
    var n = d3_time_numberRe.exec(string.substring(i, i + 1));
    return n ? (date.w = +n[0], i + n[0].length) : -1;
  }
Severity: Major
Found in cabot/static/arachnys/js/d3.js and 7 other locations - About 2 hrs to fix
cabot/static/arachnys/js/d3.js on lines 2669..2673
cabot/static/arachnys/js/d3.js on lines 2691..2695
cabot/static/arachnys/js/d3.js on lines 2696..2700
cabot/static/arachnys/js/d3.js on lines 2701..2705
cabot/static/arachnys/js/d3.js on lines 2706..2710
cabot/static/arachnys/js/d3.js on lines 2711..2715
cabot/static/arachnys/js/d3.js on lines 2716..2720

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

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

  function d3_time_parseDayOfYear(date, string, i) {
    d3_time_numberRe.lastIndex = 0;
    var n = d3_time_numberRe.exec(string.substring(i, i + 3));
    return n ? (date.j = +n[0], i + n[0].length) : -1;
  }
Severity: Major
Found in cabot/static/arachnys/js/d3.js and 7 other locations - About 2 hrs to fix
cabot/static/arachnys/js/d3.js on lines 2654..2658
cabot/static/arachnys/js/d3.js on lines 2669..2673
cabot/static/arachnys/js/d3.js on lines 2691..2695
cabot/static/arachnys/js/d3.js on lines 2701..2705
cabot/static/arachnys/js/d3.js on lines 2706..2710
cabot/static/arachnys/js/d3.js on lines 2711..2715
cabot/static/arachnys/js/d3.js on lines 2716..2720

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

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

  function d3_time_parseDay(date, string, i) {
    d3_time_numberRe.lastIndex = 0;
    var n = d3_time_numberRe.exec(string.substring(i, i + 2));
    return n ? (date.d = +n[0], i + n[0].length) : -1;
  }
Severity: Major
Found in cabot/static/arachnys/js/d3.js and 7 other locations - About 2 hrs to fix
cabot/static/arachnys/js/d3.js on lines 2654..2658
cabot/static/arachnys/js/d3.js on lines 2669..2673
cabot/static/arachnys/js/d3.js on lines 2696..2700
cabot/static/arachnys/js/d3.js on lines 2701..2705
cabot/static/arachnys/js/d3.js on lines 2706..2710
cabot/static/arachnys/js/d3.js on lines 2711..2715
cabot/static/arachnys/js/d3.js on lines 2716..2720

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

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

  function d3_time_parseMinutes(date, string, i) {
    d3_time_numberRe.lastIndex = 0;
    var n = d3_time_numberRe.exec(string.substring(i, i + 2));
    return n ? (date.M = +n[0], i + n[0].length) : -1;
  }
Severity: Major
Found in cabot/static/arachnys/js/d3.js and 7 other locations - About 2 hrs to fix
cabot/static/arachnys/js/d3.js on lines 2654..2658
cabot/static/arachnys/js/d3.js on lines 2669..2673
cabot/static/arachnys/js/d3.js on lines 2691..2695
cabot/static/arachnys/js/d3.js on lines 2696..2700
cabot/static/arachnys/js/d3.js on lines 2701..2705
cabot/static/arachnys/js/d3.js on lines 2711..2715
cabot/static/arachnys/js/d3.js on lines 2716..2720

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

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

    def __init__(self, *args, **kwargs):
        ret = super(InstanceForm, self).__init__(*args, **kwargs)
        self.fields['users_to_notify'].queryset = User.objects.filter(
            is_active=True).order_by('first_name', 'last_name')
        return ret
Severity: Major
Found in cabot/cabotapp/views.py and 1 other location - About 2 hrs to fix
cabot/cabotapp/views.py on lines 332..336

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

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

    def __init__(self, *args, **kwargs):
        ret = super(ServiceForm, self).__init__(*args, **kwargs)
        self.fields['users_to_notify'].queryset = User.objects.filter(
            is_active=True).order_by('first_name', 'last_name')
        return ret
Severity: Major
Found in cabot/cabotapp/views.py and 1 other location - About 2 hrs to fix
cabot/cabotapp/views.py on lines 290..294

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

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

    function axis(g) {
      g.each(function() {
        var g = d3.select(this);
        var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
        var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick).style("opacity", 1), tickTransform;
Severity: Major
Found in cabot/static/arachnys/js/d3.js - About 2 hrs to fix

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

      render: function() {
    
        var self = this;
    
        this.svg = d3.select(this.element)
    Severity: Major
    Found in cabot/static/arachnys/js/rickshaw.js - About 2 hrs to fix

      Function _open has 67 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _open: function( event, target, content ) {
              var tooltip, events, delayedShow,
                  positionOption = $.extend( {}, this.options.position );
      
              if ( !content ) {
      Severity: Major
      Found in cabot/static/theme/js/jquery-ui.js - About 2 hrs to fix

        Function insert has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            insert: function(after, node) {
              var parent, grandpa, uncle;
              if (after) {
                node.P = after;
                node.N = after.N;
        Severity: Major
        Found in cabot/static/arachnys/js/d3.js - About 2 hrs to fix

          Function done has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function done( status, nativeStatusText, responses, headers ) {
                var isSuccess, success, error, response, modified,
                  statusText = nativeStatusText;
          
                // Called once
          Severity: Major
          Found in cabot/static/bootstrap/js/jquery-1.10.2.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                    if (res.type == "text") {
                        res.paper.canvas.style.display = E;
                        var span = res.paper.span,
                            m = 100,
                            fontSize = a.font && a.font.match(/\d+(?:\.\d*)?(?=px)/);
            Severity: Critical
            Found in cabot/static/arachnys/js/raphael.js - About 2 hrs to fix

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

              @task(ignore_result=True)
              def run_status_check(check_or_id):
                  from .models import StatusCheck
                  if not isinstance(check_or_id, StatusCheck):
                      check = StatusCheck.objects.get(id=check_or_id)
              Severity: Major
              Found in cabot/cabotapp/tasks.py and 2 other locations - About 2 hrs to fix
              cabot/cabotapp/tasks.py on lines 56..63
              cabot/cabotapp/tasks.py on lines 66..73

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

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

              @task(ignore_result=True)
              def update_service(service_or_id):
                  from .models import Service
                  if not isinstance(service_or_id, Service):
                      service = Service.objects.get(id=service_or_id)
              Severity: Major
              Found in cabot/cabotapp/tasks.py and 2 other locations - About 2 hrs to fix
              cabot/cabotapp/tasks.py on lines 24..32
              cabot/cabotapp/tasks.py on lines 66..73

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

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

              @task(ignore_result=True)
              def update_instance(instance_or_id):
                  from .models import Instance
                  if not isinstance(instance_or_id, Instance):
                      instance = Instance.objects.get(id=instance_or_id)
              Severity: Major
              Found in cabot/cabotapp/tasks.py and 2 other locations - About 2 hrs to fix
              cabot/cabotapp/tasks.py on lines 24..32
              cabot/cabotapp/tasks.py on lines 56..63

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

              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

                                          if (o._.arrows) {
                                              "startString" in o._.arrows && addArrow(o, o._.arrows.startString);
                                              "endString" in o._.arrows && addArrow(o, o._.arrows.endString, 1);
                                          }
              Severity: Major
              Found in cabot/static/arachnys/js/raphael.js and 1 other location - About 2 hrs to fix
              cabot/static/arachnys/js/raphael.js on lines 4203..4206

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

              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.vis
                    .append("svg:g")
                    .attr("class", ["x_ticks_d3", this.ticksTreatment].join(" "))
                    .attr("transform", transform)
                    .call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));
              Severity: Major
              Found in cabot/static/arachnys/js/rickshaw.js and 1 other location - About 2 hrs to fix
              cabot/static/arachnys/js/rickshaw.js on lines 1685..1689

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

              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 (this.node.parentNode.tagName.toLowerCase() == "a") {
                          this.node.parentNode.parentNode.appendChild(this.node.parentNode);
                      } else {
                          this.node.parentNode.appendChild(this.node);
                      }
              Severity: Major
              Found in cabot/static/arachnys/js/raphael.js and 1 other location - About 2 hrs to fix
              cabot/static/arachnys/js/raphael.js on lines 4485..4489

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

              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 = offsets.length; i--;) {
                        activeTarget != targets[i]
                          && scrollTop >= offsets[i]
                          && (!offsets[i + 1] || scrollTop <= offsets[i + 1])
                          && this.activate( targets[i] )
              Severity: Major
              Found in cabot/static/theme/js/bootstrap.js and 1 other location - About 2 hrs to fix
              cabot/static/bootstrap/js/bootstrap.js on lines 1870..1875

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

              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.vis
                    .append("svg:g")
                    .attr("class", ["y_ticks", this.ticksTreatment].join(" "))
                    .attr("transform", transform)
                    .call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));
              Severity: Major
              Found in cabot/static/arachnys/js/rickshaw.js and 1 other location - About 2 hrs to fix
              cabot/static/arachnys/js/rickshaw.js on lines 1551..1555

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

              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