kuasha/cosmos

View on GitHub
samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js

Summary

Maintainability
F
2 wks
Test Coverage

Function ScssHighlightRules has 223 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var ScssHighlightRules = function() {
    
    var properties = lang.arrayToMap( (function () {

        var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
Severity: Major
Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js - About 1 day to fix

    File mode-sass.js has 360 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
    "use strict";
    
    var oop = require("../lib/oop");
    var lang = require("../lib/lang");
    Severity: Minor
    Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js - About 4 hrs to fix

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

          var properties = lang.arrayToMap( (function () {
      
              var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|");
              
              var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + 
      Severity: Major
      Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js - About 2 hrs to fix

        Function getFoldWidget has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.getFoldWidget = function(session, foldStyle, row) {
                var line = session.getLine(row);
                var indent = line.search(/\S/);
                var next = session.getLine(row + 1);
                var prev = session.getLine(row - 1);
        Severity: Minor
        Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js - About 1 hr to fix

          Function SassHighlightRules has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var SassHighlightRules = function() {
              ScssHighlightRules.call(this);
              var start = this.$rules.start;
              if (start[1].token == "comment") {
                  start.splice(1, 1, {
          Severity: Minor
          Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js - About 1 hr to fix

            Avoid too many return statements within this function.
            Open

                                    return "text";
            Severity: Major
            Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return "";
              Severity: Major
              Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                        return "variable.language";
                Severity: Major
                Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                          return "support.constant.color";
                  Severity: Major
                  Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-sass.js - About 30 mins to fix

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

                    define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
                    "use strict";
                    
                    var oop = require("../lib/oop");
                    var lang = require("../lib/lang");
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-jade.js on lines 988..1240
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-scss.js on lines 1..253

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

                    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 18 locations. Consider refactoring.
                    Open

                    define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
                    "use strict";
                    
                    var oop = require("../../lib/oop");
                    var BaseFoldMode = require("./fold_mode").FoldMode;
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-abap.js on lines 97..182
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-assembly_x86.js on lines 78..163
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-cirru.js on lines 95..180
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-coffee.js on lines 243..328
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-ejs.js on lines 2535..2620
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-haml.js on lines 356..441
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-html_ruby.js on lines 2590..2675
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-jade.js on lines 1885..1970
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-logiql.js on lines 75..160
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-makefile.js on lines 188..273
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-pascal.js on lines 84..169
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-ruby.js on lines 266..351
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-snippets.js on lines 1..86
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-space.js on lines 1..86
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-stylus.js on lines 305..390
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-velocity.js on lines 2481..2566
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-yaml.js on lines 122..207

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

                    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

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

                    define("ace/mode/sass_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/scss_highlight_rules"], function(require, exports, module) {
                    "use strict";
                    
                    var oop = require("../lib/oop");
                    var lang = require("../lib/lang");
                    samples/adminpanel/app/bower_components/ace-builds/src-noconflict/mode-sass.js on lines 255..302

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

                    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 6 locations. Consider refactoring.
                    Open

                    define("ace/mode/sass",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/sass_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) {
                    "use strict";
                    
                    var oop = require("../lib/oop");
                    var TextMode = require("./text").Mode;
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-apache_conf.js on lines 290..310
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-assembly_x86.js on lines 165..185
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-cirru.js on lines 182..202
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-jade.js on lines 1972..1993
                    samples/adminpanel/app/bower_components/ace-builds/src/mode-toml.js on lines 121..141

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

                    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

                    There are no issues that match your filters.

                    Category
                    Status