sleepepi/sleepportal

View on GitHub

Showing 332 of 436 total issues

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

    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

                Function drawTracker has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    drawTracker: function () {
                        var series = this,
                            options = series.options,
                            trackByArea = options.trackByArea,
                            trackerPath = [].concat(trackByArea ? series.areaPath : series.graphPath),
                Severity: Major
                Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

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

                      init: function (chart, userOptions) {
                              
                          
                          var isXAxis = userOptions.isX,
                              axis = this;
                  Severity: Major
                  Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                    Function getPointSpline has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        getPointSpline: function (segment, point, i) {
                            var smoothing = 1.5, // 1 means control points midway between points, 2 means 1/3 from the point, 3 is 1/4 etc
                                denom = smoothing + 1,
                                plotX = point.plotX,
                                plotY = point.plotY,
                    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 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                        def graph_values(current_user)
                          categories = []
                          mapping_values = []
                      
                          if ['numeric', 'integer', 'date', 'choices'].include?(self.variable_type)
                      Severity: Minor
                      Found in app/models/variable.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 renderRegion has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              renderRegion: function (valuenum, highlight) {
                                  var vals = this.values[valuenum],
                                      options = this.options,
                                      xaxisOffset = this.xaxisOffset,
                                      result = [],
                      Severity: Major
                      Found in app/assets/javascripts/external/jquery.sparkline.js - About 2 hrs to fix

                        Function pinchTranslateDirection has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            pinchTranslateDirection: function (horiz, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch, forcedScale) {
                                var chart = this.chart,
                                    xy = horiz ? 'x' : 'y',
                                    XY = horiz ? 'X' : 'Y',
                                    sChartXY = 'chart' + XY,
                        Severity: Major
                        Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                          Function normalizeTimeTickInterval has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function normalizeTimeTickInterval(tickInterval, unitsOption) {
                              var units = unitsOption || [[
                                          MILLISECOND, // unit name
                                          [1, 2, 5, 10, 20, 25, 50, 100, 200, 500] // allowed multiples
                                      ], [
                          Severity: Major
                          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                            Method generate_sql_as_normal has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def generate_sql_as_normal(thesource)
                                  result = "1 = 0"
                            
                                  result_hash = thesource.sql_codes(current_user)
                                  sql_text = result_hash[:text]
                            Severity: Major
                            Found in app/models/resolver.rb - About 2 hrs to fix

                              Function getSegments has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  getSegments: function () {
                                      var segments = [],
                                          segment = [],
                                          keys = [],
                                          xAxis = this.xAxis,
                              Severity: Major
                              Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 2 hrs to fix

                                Function getContainer has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

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

                                  Method directional_do! has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    def directional_do!(position, direction)
                                      current_position = self.history_position + position
                                      if current_position >= 0 and current_position < self.history.size
                                        history_hash = self.history[current_position].symbolize_keys
                                        qc = Criterium.find_by_id(history_hash[:id])
                                  Severity: Minor
                                  Found in app/models/search.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 pinch has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

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

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

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