sleepepi/sleepportal

View on GitHub

Showing 436 of 436 total issues

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

            if (this.selectionMarker && zoomVert) {
                size = chartY - mouseDownY;
                this.selectionMarker.attr({
                    height: mathAbs(size),
                    y: (size > 0 ? 0 : size) + mouseDownY
Severity: Major
Found in app/assets/javascripts/external/highcharts-3.0.7.src.js and 1 other location - About 1 hr to fix
app/assets/javascripts/external/highcharts-3.0.7.src.js on lines 9547..9553

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

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.selectionMarker && zoomHor) {
                size = chartX - mouseDownX;
                this.selectionMarker.attr({
                    width: mathAbs(size),
                    x: (size > 0 ? 0 : size) + mouseDownX
Severity: Major
Found in app/assets/javascripts/external/highcharts-3.0.7.src.js and 1 other location - About 1 hr to fix
app/assets/javascripts/external/highcharts-3.0.7.src.js on lines 9555..9561

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

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

    runPointActions: function (e) {
        var pointer = this,
            chart = pointer.chart,
            series = chart.series,
            tooltip = chart.tooltip,
Severity: Minor
Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

    Function shadow has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        shadow: function (shadowOptions, group, cutOff) {
            var shadows = [],
                i,
                element = this.element,
                renderer = this.renderer,
    Severity: Minor
    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

      Method graph_values_short has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

        def graph_values_short(current_user)
          values = self.all_values_for_column(current_user)[:values]
      
          case self.variable.variable_type when 'integer'
            values = values.select{|v| not v.blank?}.collect{|num_string| num_string.to_i} # Ignore null and blank values!
      Severity: Minor
      Found in app/models/mapping.rb - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

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

                      if (loutlier < lwhisker) {
                          target.drawCircle((loutlier - minValue) * unitSize + canvasLeft,
                              canvasHeight / 2,
                              options.get('spotRadius'),
                              options.get('outlierLineColor'),
      Severity: Major
      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/external/jquery.sparkline.js on lines 2460..2466

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

      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 (routlier > rwhisker) {
                          target.drawCircle((routlier - minValue) * unitSize + canvasLeft,
                              canvasHeight / 2,
                              options.get('spotRadius'),
                              options.get('outlierLineColor'),
      Severity: Major
      Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 1 hr to fix
      app/assets/javascripts/external/jquery.sparkline.js on lines 2453..2459

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

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

          scroll: function (scrollBy, animation) {
              var pageCount = this.pageCount,
                  currentPage = this.currentPage + scrollBy,
                  clipHeight = this.clipHeight,
                  navOptions = this.options.navigation,
      Severity: Minor
      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

        Function setSize has 47 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            setSize: function (width, height, animation) {
                var chart = this,
                    chartWidth,
                    chartHeight,
                    fireEndResize;
        Severity: Minor
        Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

          Function processData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              processData: function (force) {
                  var series = this,
                      processedXData = series.xData, // copied during slice operation below
                      processedYData = series.yData,
                      dataLength = processedXData.length,
          Severity: Minor
          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

            Function destroy has 47 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                destroy: function () {
                    var series = this,
                        chart = series.chart,
                        issue134 = /AppleWebKit\/533/.test(userAgent),
                        destroy,
            Severity: Minor
            Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

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

                              if (!defined(options.max) && !defined(axis.userMax)  && maxPadding && (axis.dataMax > 0 || !axis.ignoreMaxPadding)) {
                                  axis.max += length * maxPadding;
                              }
              Severity: Major
              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js and 1 other location - About 1 hr to fix
              app/assets/javascripts/external/highcharts-3.0.7.src.js on lines 7548..7550

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

              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 (!defined(options.min) && !defined(axis.userMin) && minPadding && (axis.dataMin < 0 || !axis.ignoreMinPadding)) {
                                  axis.min -= length * minPadding;
                              }
              Severity: Major
              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js and 1 other location - About 1 hr to fix
              app/assets/javascripts/external/highcharts-3.0.7.src.js on lines 7551..7553

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

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

                  setScale: function () {
                      var axis = this,
                          stacks = axis.stacks,
                          type,
                          i,
              Severity: Minor
              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                Function arc has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        arc: function (x, y, w, h, options) {
                            var start = options.start,
                                end = options.end,
                                radius = options.r || w || h,
                                innerRadius = options.innerR,
                Severity: Minor
                Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                  Function setTooltipPoints has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      setTooltipPoints: function (renew) {
                          var series = this,
                              points = [],
                              pointsLength,
                              low,
                  Severity: Minor
                  Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                    Function generatePoints has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        generatePoints: function () {
                            var series = this,
                                options = series.options,
                                dataOptions = options.data,
                                data = series.data,
                    Severity: Minor
                    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                      Function add has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                  wrapper.add = function (svgGroupWrapper) {
                      
                                      var htmlGroup,
                                          container = renderer.box.parentNode,
                                          parentGroup,
                      Severity: Minor
                      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

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

                            drop: function (e) {
                                var chart = this.chart,
                                    hasPinched = this.hasPinched;
                        
                                if (this.selectionMarker) {
                        Severity: Minor
                        Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                          Function animate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              animate: function (init) {
                                  var series = this,
                                      chart = series.chart,
                                      renderer = chart.renderer,
                                      clipRect,
                          Severity: Minor
                          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language