sleepepi/sleepportal

View on GitHub

Showing 436 of 436 total issues

Function drawChartBox has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    drawChartBox: function () {
        var chart = this,
            optionsChart = chart.options.chart,
            renderer = chart.renderer,
            chartWidth = chart.chartWidth,
Severity: Major
Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

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

        setData: function (data, redraw) {
            var series = this,
                oldData = series.points,
                options = series.options,
                chart = series.chart,
    Severity: Major
    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

      Function color has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          color: function (color, elem, prop) {
              var renderer = this,
                  colorObject,
                  regexRgba = /^rgba/,
                  gradName,
      Severity: Major
      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

        Function getAttribs has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            getAttribs: function () {
                var series = this,
                    seriesOptions = series.options,
                    normalOptions = defaultPlotOptions[series.type].marker ? seriesOptions.marker : seriesOptions,
                    stateOptions = normalOptions.states,
        Severity: Major
        Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

          Function html has 82 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              html: function (str, x, y) {
                  var defaultChartStyle = defaultOptions.chart.style,
                      wrapper = this.createElement('span'),
                      attrSetters = wrapper.attrSetters,
                      element = wrapper.element,
          Severity: Major
          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

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

                        target.drawLine(
                            Math.round((lwhisker - minValue) * unitSize + canvasLeft),
                            Math.round(canvasHeight / 4),
                            Math.round((lwhisker - minValue) * unitSize + canvasLeft),
                            Math.round(canvasHeight - canvasHeight / 4),
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/external/jquery.sparkline.js on lines 2496..2501

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

            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

                        target.drawLine(
                            Math.round((rwhisker - minValue) * unitSize + canvasLeft),
                            Math.round(canvasHeight / 4),
                            Math.round((rwhisker - minValue) * unitSize + canvasLeft),
                            Math.round(canvasHeight - canvasHeight / 4),
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 3 hrs to fix
            app/assets/javascripts/external/jquery.sparkline.js on lines 2484..2489

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

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

                translate: function (positions) {
                    this.generatePoints();
                    
                    var series = this,
                        cumulative = 0,
            Severity: Major
            Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

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

                          target.drawLine(Math.round((rwhisker - minValue) * unitSize + canvasLeft),
                              Math.round(canvasHeight / 2),
                              Math.round((q3 - minValue) * unitSize + canvasLeft),
                              Math.round(canvasHeight / 2),
                              options.get('lineColor')).append();
              Severity: Major
              Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 3 hrs to fix
              app/assets/javascripts/external/jquery.sparkline.js on lines 2478..2483
              app/assets/javascripts/external/jquery.sparkline.js on lines 2503..2508

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

              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

                          target.drawLine(
                              Math.round((lwhisker - minValue) * unitSize + canvasLeft),
                              Math.round(canvasHeight / 2),
                              Math.round((q1 - minValue) * unitSize + canvasLeft),
                              Math.round(canvasHeight / 2),
              Severity: Major
              Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 3 hrs to fix
              app/assets/javascripts/external/jquery.sparkline.js on lines 2491..2495
              app/assets/javascripts/external/jquery.sparkline.js on lines 2503..2508

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

              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

                          target.drawLine(
                              Math.round((q2 - minValue) * unitSize + canvasLeft),
                              Math.round(canvasHeight * 0.1),
                              Math.round((q2 - minValue) * unitSize + canvasLeft),
                              Math.round(canvasHeight * 0.9),
              Severity: Major
              Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 3 hrs to fix
              app/assets/javascripts/external/jquery.sparkline.js on lines 2478..2483
              app/assets/javascripts/external/jquery.sparkline.js on lines 2491..2495

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

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

                      initContainer: function () {
              
                          var selector = ".select2-choices", selection;
              
                          this.searchContainer = this.container.find(".select2-search-field");
              Severity: Major
              Found in app/assets/javascripts/external/select2.js - About 3 hrs to fix

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

                    render: function () {
                        var chart = this,
                            axes = chart.axes,
                            renderer = chart.renderer,
                            options = chart.options;
                Severity: Major
                Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (
                                  // already has this state
                                  state === point.state ||
                                  // selected points don't respond to hover
                                  (point.selected && state !== SELECT_STATE) ||
                  Severity: Critical
                  Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

                    Consider simplifying this complex logical expression.
                    Open

                            if (optionsLabel && defined(optionsLabel.text) && path && path.length && axis.width > 0 && axis.height > 0) {
                                // apply defaults
                                optionsLabel = merge({
                                    align: horiz && isBand && 'center',
                                    x: horiz ? !isBand && 4 : 10,
                    Severity: Critical
                    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 3 hrs to fix

                      Function Color has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var Color = function (input) {
                          // declare variables
                          var rgba = [], result, stops;
                      
                          /**
                      Severity: Major
                      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                        Function getTimeTicks has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function getTimeTicks(normalizedInterval, min, max, startOfWeek) {
                            var tickPositions = [],
                                i,
                                higherRanks = {},
                                useUTC = defaultOptions.global.useUTC,
                        Severity: Major
                        Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                          Function getMargins has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              getMargins: function () {
                                  var chart = this,
                                      spacing = chart.spacing,
                                      axisOffset,
                                      legend = chart.legend,
                          Severity: Major
                          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                            Function clipNeg has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                clipNeg: function () {
                                    var options = this.options,
                                        chart = this.chart,
                                        renderer = chart.renderer,
                                        negativeColor = options.negativeColor || options.negativeFillColor,
                            Severity: Major
                            Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                              Method generate_report_table has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def generate_report_table(current_user)
                                  filtered_report_concepts = self.report_concepts.select{|rc| not rc.position.blank?}
                                  values = self.search.view_concept_values(current_user, filtered_report_concepts)
                              
                                  row_values = []
                              Severity: Major
                              Found in app/models/report.rb - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language