sleepepi/sleepportal

View on GitHub

Showing 436 of 436 total issues

Function addPoint has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    addPoint: function (options, redraw, shift, animation) {
        var series = this,
            seriesOptions = series.options,
            data = series.data,
            graph = series.graph,
Severity: Major
Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

    Function addLabel has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        addLabel: function () {
            var tick = this,
                axis = tick.axis,
                options = axis.options,
                chart = axis.chart,
    Severity: Major
    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

      Function getLogTickPositions has 69 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          getLogTickPositions: function (interval, min, max, minor) {
              var axis = this,
                  options = axis.options,
                  axisLength = axis.len,
                  // Since we use this method for both major and minor ticks,
      Severity: Major
      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

        Method graph_values has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          def graph_values(current_user)
            categories = []
            values = self.all_values_for_column(current_user)[:values]
        
            case self.variable.variable_type when 'numeric', 'integer'
        Severity: Minor
        Found in app/models/mapping.rb - About 2 hrs 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 init has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                init: function (opts) {
                    var results, search, resultsSelector = ".select2-results";
        
                    // prepare options
                    this.opts = opts = this.prepareOpts(opts);
        Severity: Major
        Found in app/assets/javascripts/external/select2.js - About 2 hrs to fix

          Function setState has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              setState: function (state) {
                  var point = this,
                      plotX = point.plotX,
                      plotY = point.plotY,
                      series = point.series,
          Severity: Major
          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

            Function sparkline has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                $.fn.sparkline = function (userValues, userOptions) {
                    return this.each(function () {
                        var options = new $.fn.sparkline.options(this, userOptions),
                             $this = $(this),
                             render, i;
            Severity: Major
            Found in app/assets/javascripts/external/jquery.sparkline.js - About 2 hrs to fix

              Function updateResults has 66 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      updateResults: function (initial) {
                          var search = this.search, results = this.results, opts = this.opts, data, self=this, input;
              
                          // if the search is currently hidden we do not alter the results
                          if (initial !== true && (this.showSearchInput === false || !this.opened())) {
              Severity: Major
              Found in app/assets/javascripts/external/select2.js - About 2 hrs to fix

                Method import_variables has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                  def import_variables(file_name)
                    version = Time.now.to_i.to_s
                
                    CSV.parse( File.open(file_name, 'r:iso-8859-1:utf-8'){|f| f.read}, headers: true ) do |line|
                      row = line.to_hash
                Severity: Minor
                Found in app/models/dictionary.rb - About 2 hrs 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 update has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                Open

                  def update
                    @criterium = @search.criteria.find_by_id(params[:id])
                    if @criterium
                      params[:criterium] = {} if params[:criterium].blank?
                      params[:criterium][:right_operator] = 'and' unless Criterium::OPERATOR.include?(params[:criterium][:right_operator])
                Severity: Minor
                Found in app/controllers/criteria_controller.rb - About 2 hrs 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 drag has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    drag: function (e) {
                
                        var chart = this.chart,
                            chartOptions = chart.options.chart,
                            chartX = e.chartX,
                Severity: Major
                Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                  Function translate has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      translate: function () {
                          var series = this,
                              chart = series.chart,
                              options = series.options,
                              borderWidth = options.borderWidth,
                  Severity: Major
                  Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

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

                                vel = '<v:shape coordorigin="0 0" coordsize="' + this.pixelWidth + ' ' + this.pixelHeight + '" ' +
                                     ' id="jqsshape' + shapeid + '" ' +
                                     stroke +
                                     fill +
                                    ' style="position:absolute;left:0px;top:0px;height:' + this.pixelHeight + 'px;width:' + this.pixelWidth + 'px;padding:0px;margin:0px;" ' +
                    Severity: Major
                    Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/external/jquery.sparkline.js on lines 2972..2977

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

                    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

                                vel = '<v:shape coordorigin="0 0" coordsize="' + this.pixelWidth + ' ' + this.pixelHeight + '" ' +
                                     ' id="jqsshape' + shapeid + '" ' +
                                     stroke +
                                     fill +
                                    ' style="position:absolute;left:0px;top:0px;height:' + this.pixelHeight + 'px;width:' + this.pixelWidth + 'px;padding:0px;margin:0px;" ' +
                    Severity: Major
                    Found in app/assets/javascripts/external/jquery.sparkline.js and 1 other location - About 2 hrs to fix
                    app/assets/javascripts/external/jquery.sparkline.js on lines 2915..2920

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

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

                        setStackedPoints: function () {
                            if (!this.options.stacking || (this.visible !== true && this.chart.options.chart.ignoreHiddenSeries !== false)) {
                                return;
                            }
                    
                    
                    Severity: Major
                    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                      Function symbol has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          symbol: function (symbol, x, y, width, height, options) {
                      
                              var obj,
                      
                                  // get the symbol definition function
                      Severity: Major
                      Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

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

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

                          Function getCurrentRegionTooltip has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  getCurrentRegionTooltip: function () {
                                      var options = this.options,
                                          header = '',
                                          entries = [],
                                          fields, formats, formatlen, fclass, text, i,
                          Severity: Major
                          Found in app/assets/javascripts/external/jquery.sparkline.js - About 2 hrs to fix

                            Function drawPoints has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                drawPoints: function () {
                                    var series = this,
                                        pointAttr,
                                        points = series.points,
                                        chart = series.chart,
                            Severity: Major
                            Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                              Function translate has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  translate: function () {
                                      if (!this.processedXData) { // hidden series
                                          this.processData();
                                      }
                                      this.generatePoints();
                              Severity: Major
                              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language