sleepepi/sleepportal

View on GitHub

Showing 436 of 436 total issues

Function update has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    update: function (options, redraw, animation) {
        var point = this,
            series = point.series,
            graphic = point.graphic,
            i,
Severity: Minor
Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

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

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

      Function init has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          init: function (userOptions, callback) {
      
              // Handle regular options
              var options,
                  seriesOptions = userOptions.series; // skip merging data points to increase performance
      Severity: Minor
      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

        Function updateDisplay has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                updateDisplay: function () {
                    var splist = this.splist,
                         spcount = splist.length,
                         needsRefresh = false,
                         offset = this.$canvas.offset(),
        Severity: Minor
        Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

          Method token_ranges has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def token_ranges
              results = []
          
              self.value.to_s.split(',').each do |val|
                token_hash = self.find_tokens(val)
          Severity: Minor
          Found in app/models/criterium.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

          Method show has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            def show
              if params[:popup] == 'true'
                @source = Source.available.find_by_id(params[:id])
                @search = current_user.searches.find_by_id(params[:search_id])
                if @source and @search
          Severity: Minor
          Found in app/controllers/sources_controller.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

          Function getAnchor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              getAnchor: function (points, mouseEvent) {
                  var ret,
                      chart = this.chart,
                      inverted = chart.inverted,
                      plotTop = chart.plotTop,
          Severity: Minor
          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

            Function showLoading has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                showLoading: function (str) {
                    var chart = this,
                        options = chart.options,
                        loadingDiv = chart.loadingDiv;
            
            
            Severity: Minor
            Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

              Function drawGraph has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  drawGraph: function () {
                      var series = this,
                          options = this.options,
                          props = [['graph', options.lineColor || this.color]],
                          lineWidth = options.lineWidth,
              Severity: Minor
              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

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

                        'arc': function (x, y, w, h, options) {
                            var start = options.start,
                                radius = options.r || w || h,
                                end = options.end - 0.001, // to prevent cos and sin of start and end from becoming equal on 360 arcs (related: #1561)
                                innerRadius = options.innerR,
                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 ((isFirst && !reversed) || (isLast && reversed)) {
                                  // Is the label spilling out to the left of the plot area?
                                  if (x + leftSide < plotLeft) {
                  
                                      // Align it to plot left
                  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 5954..5967

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

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                              } else {
                                  // Is the label spilling out to the right of the plot area?
                                  if (x + rightSide > plotRight) {
                  
                                      // Align it to plot right
                  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 5941..5954

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

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

                      setTitle: function (titleOptions, subtitleOptions) {
                          var chart = this,
                              options = chart.options,
                              chartTitleOptions,
                              chartSubtitleOptions;
                  Severity: Minor
                  Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                    Function onContainerClick has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        onContainerClick: function (e) {
                            var chart = this.chart,
                                hoverPoint = chart.hoverPoint, 
                                plotLeft = chart.plotLeft,
                                plotTop = chart.plotTop,
                    Severity: Minor
                    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                      Function handleOverflow has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          handleOverflow: function (index, xy) {
                              var show = true,
                                  axis = this.axis,
                                  chart = axis.chart,
                                  isFirst = this.isFirst,
                      Severity: Minor
                      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                        Function select2 has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            $.fn.select2 = function () {
                        
                                var args = Array.prototype.slice.call(arguments, 0),
                                    opts,
                                    select2,
                        Severity: Minor
                        Found in app/assets/javascripts/external/select2.js - About 1 hr to fix

                          Function alignDataLabel has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              alignDataLabel: function (point, dataLabel, options,  alignTo, isNew) {
                                  var chart = this.chart,
                                      inverted = chart.inverted,
                                      dlBox = point.dlBox || point.shapeArgs, // data label box for alignment
                                      below = point.below || (point.plotY > pick(this.translatedThreshold, chart.plotSizeY)),
                          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 (options.get('chartRangeMin') !== undefined && (options.get('chartRangeClip') || options.get('chartRangeMin') < min)) {
                                            min = options.get('chartRangeMin');
                                        }
                            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 1777..1779

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

                            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 (chart.hasRendered) {
                                        each(chart.series, function (otherSeries) {
                                            if (otherSeries.type === series.type) {
                                                otherSeries.isDirty = true;
                                            }
                            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 16057..16063

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

                            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 (chart.hasRendered) {
                                        each(chart.series, function (otherSeries) {
                                            if (otherSeries.type === series.type) {
                                                otherSeries.isDirty = true;
                                            }
                            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 15696..15702

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

                            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