sleepepi/sleepportal

View on GitHub

Showing 436 of 436 total issues

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

            if (this.targetX !== undefined && this.targetY !== undefined &&
                context.isPointInPath(this.targetX, this.targetY)) {
                this.currentTargetShapeId = shapeid;
            }
Severity: Major
Found in app/assets/javascripts/external/jquery.sparkline.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/external/jquery.sparkline.js on lines 2753..2756
app/assets/javascripts/external/jquery.sparkline.js on lines 2778..2781

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

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 {
            x1 = axisLeft;
            x2 = cWidth - axis.right;

            if (y1 < axisTop || y1 > axisTop + axis.height) {
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 7113..7119

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

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 (off < 0) {
            if (verticalAlign === 'bottom') {
                options.verticalAlign = 'top';
            } else {
                options.y = -off;
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 14584..14591

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

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

    getPosition: function (boxWidth, boxHeight, point) {
        
        // Set up the variables
        var chart = this.chart,
            plotLeft = chart.plotLeft,
Severity: Minor
Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

    Function css has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        css: function (styles) {
            /*jslint unparam: true*//* allow unused param a in the regexp function below */
            var elemWrapper = this,
                elem = elemWrapper.element,
                textWidth = elemWrapper.textWidth = styles && styles.width && elem.nodeName.toLowerCase() === 'text' && pInt(styles.width),
    Severity: Minor
    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

      Method graph_values has 29 lines of code (exceeds 25 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 1 hr to fix

        Function getTagSetting has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                getTagSetting: function (key) {
                    var prefix = this.tagOptionsPrefix,
                        val, i, pairs, keyval;
                    if (prefix === false || prefix === undefined) {
                        return UNSET_OPTION;
        Severity: Minor
        Found in app/assets/javascripts/external/jquery.sparkline.js - About 1 hr to fix

          Function val has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  val: function () {
                      var val, data = [], self=this;
          
                      if (arguments.length === 0) {
                          return this.getVal();
          Severity: Minor
          Found in app/assets/javascripts/external/select2.js - About 1 hr to fix

            Function val has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    val: function () {
                        var val, data = null, self = this;
            
                        if (arguments.length === 0) {
                            return this.opts.element.val();
            Severity: Minor
            Found in app/assets/javascripts/external/select2.js - About 1 hr to fix

              Method total_records_count has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def total_records_count
                  total_records_found = 0
                  @overall_totals = {}
                  @overall_errors = {}
              
              
              Severity: Minor
              Found in app/controllers/searches_controller.rb - About 1 hr to fix

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

                                $(document).find("div.select2-container-active").each(function () {
                                    if (this !== target) $(this).data("select2").blur();
                                });
                Severity: Major
                Found in app/assets/javascripts/external/select2.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/external/select2.js on lines 505..507

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

                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

                      unless params[:domains_file].blank?
                        if params[:domains_file].original_filename =~ /.*\.csv/i
                          @dictionary.import_domains(params[:domains_file].tempfile.path)
                        else
                          flash[:alert] = "Unsupported domains file format!"
                Severity: Major
                Found in app/controllers/dictionaries_controller.rb and 1 other location - About 1 hr to fix
                app/controllers/dictionaries_controller.rb on lines 40..57

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

                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

                      unless params[:domains_file].blank?
                        if params[:domains_file].original_filename =~ /.*\.csv/i
                          @dictionary.import_domains(params[:domains_file].tempfile.path)
                        else
                          flash[:alert] = "Unsupported domains file format!"
                Severity: Major
                Found in app/controllers/dictionaries_controller.rb and 1 other location - About 1 hr to fix
                app/controllers/dictionaries_controller.rb on lines 66..82

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

                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

                                $(document).find("div.select2-drop-active").each(function () {
                                    if (this !== target) $(this).data("select2").blur();
                                });
                Severity: Major
                Found in app/assets/javascripts/external/select2.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/external/select2.js on lines 500..502

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

                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 label has 9 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    label: function (str, x, y, shape, anchorX, anchorY, useHTML, baseline, className) {
                Severity: Major
                Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                  Function button has 9 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      button: function (text, x, y, callback, normalState, hoverState, pressedState, disabledState, shape) {
                  Severity: Major
                  Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                    Function tooltipHeaderFormatter has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        tooltipHeaderFormatter: function (point) {
                            var series = this,
                                tooltipOptions = series.tooltipOptions,
                                xDateFormat = tooltipOptions.xDateFormat,
                                dateTimeLabelFormats = tooltipOptions.dateTimeLabelFormats,
                    Severity: Minor
                    Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix

                      Function setDOMEvents has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

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

                        Function firstRender has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

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

                          Function getTitlePosition has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              getTitlePosition: function () {
                                  // compute anchor points for each of the title align options
                                  var horiz = this.horiz,
                                      axisLeft = this.left,
                                      axisTop = this.top,
                          Severity: Minor
                          Found in app/assets/javascripts/external/highcharts-3.0.7.src.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language