kuasha/cosmos

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

Summary

Maintainability
F
2 wks
Test Coverage

Function RubyHighlightRules has 171 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var RubyHighlightRules = function() {

    var builtinFunctions = (
        "abort|Array|assert|assert_equal|assert_not_equal|assert_same|assert_not_same|" +
        "assert_nil|assert_not_nil|assert_match|assert_no_match|assert_in_delta|assert_throws|" +
Severity: Major
Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-ruby.js - About 6 hrs to fix

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

    define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
    "use strict";
    
    var oop = require("../lib/oop");
    var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
    Severity: Minor
    Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-ruby.js - About 4 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-ruby.js - About 1 hr 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-ruby.js - About 30 mins to fix

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

          define("ace/mode/ruby_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
          "use strict";
          
          var oop = require("../lib/oop");
          var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
          samples/adminpanel/app/bower_components/ace-builds/src/mode-ejs.js on lines 2310..2533
          samples/adminpanel/app/bower_components/ace-builds/src/mode-haml.js on lines 1..224
          samples/adminpanel/app/bower_components/ace-builds/src/mode-html_ruby.js on lines 793..1016

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

          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-sass.js on lines 304..389
          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

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

          define("ace/mode/ruby",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/ruby_highlight_rules","ace/mode/matching_brace_outdent","ace/range","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-ejs.js on lines 2622..2689
          samples/adminpanel/app/bower_components/ace-builds/src/mode-html_ruby.js on lines 2677..2744

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

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

          define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
          "use strict";
          
          var Range = require("../range").Range;
          
          
          samples/adminpanel/app/bower_components/ace-builds/src/mode-c9search.js on lines 147..185
          samples/adminpanel/app/bower_components/ace-builds/src/mode-c_cpp.js on lines 223..261
          samples/adminpanel/app/bower_components/ace-builds/src/mode-coffee.js on lines 203..241
          samples/adminpanel/app/bower_components/ace-builds/src/mode-coldfusion.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-csharp.js on lines 136..174
          samples/adminpanel/app/bower_components/ace-builds/src/mode-css.js on lines 145..183
          samples/adminpanel/app/bower_components/ace-builds/src/mode-curly.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-dart.js on lines 223..261
          samples/adminpanel/app/bower_components/ace-builds/src/mode-django.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-dot.js on lines 1..39
          samples/adminpanel/app/bower_components/ace-builds/src/mode-ejs.js on lines 793..831
          samples/adminpanel/app/bower_components/ace-builds/src/mode-glsl.js on lines 223..261
          samples/adminpanel/app/bower_components/ace-builds/src/mode-golang.js on lines 154..192
          samples/adminpanel/app/bower_components/ace-builds/src/mode-groovy.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-handlebars.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-haxe.js on lines 139..177
          samples/adminpanel/app/bower_components/ace-builds/src/mode-html.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-html_ruby.js on lines 1073..1111
          samples/adminpanel/app/bower_components/ace-builds/src/mode-jack.js on lines 111..149
          samples/adminpanel/app/bower_components/ace-builds/src/mode-java.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-javascript.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-json.js on lines 69..107
          samples/adminpanel/app/bower_components/ace-builds/src/mode-jsp.js on lines 977..1015
          samples/adminpanel/app/bower_components/ace-builds/src/mode-jsx.js on lines 164..202
          samples/adminpanel/app/bower_components/ace-builds/src/mode-less.js on lines 230..268
          samples/adminpanel/app/bower_components/ace-builds/src/mode-liquid.js on lines 885..923
          samples/adminpanel/app/bower_components/ace-builds/src/mode-livescript.js on lines 1..39
          samples/adminpanel/app/bower_components/ace-builds/src/mode-logiql.js on lines 520..558
          samples/adminpanel/app/bower_components/ace-builds/src/mode-lsl.js on lines 95..133
          samples/adminpanel/app/bower_components/ace-builds/src/mode-luapage.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-markdown.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-nix.js on lines 223..261
          samples/adminpanel/app/bower_components/ace-builds/src/mode-ocaml.js on lines 309..347
          samples/adminpanel/app/bower_components/ace-builds/src/mode-perl.js on lines 134..172
          samples/adminpanel/app/bower_components/ace-builds/src/mode-powershell.js on lines 142..180
          samples/adminpanel/app/bower_components/ace-builds/src/mode-protobuf.js on lines 223..261
          samples/adminpanel/app/bower_components/ace-builds/src/mode-r.js on lines 238..276
          samples/adminpanel/app/bower_components/ace-builds/src/mode-rdoc.js on lines 111..149
          samples/adminpanel/app/bower_components/ace-builds/src/mode-rhtml.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-scad.js on lines 155..193
          samples/adminpanel/app/bower_components/ace-builds/src/mode-scala.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-scss.js on lines 255..293
          samples/adminpanel/app/bower_components/ace-builds/src/mode-sjs.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-smarty.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-soy_template.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-svg.js on lines 966..1004
          samples/adminpanel/app/bower_components/ace-builds/src/mode-tcl.js on lines 237..275
          samples/adminpanel/app/bower_components/ace-builds/src/mode-tex.js on lines 80..118
          samples/adminpanel/app/bower_components/ace-builds/src/mode-textile.js on lines 65..103
          samples/adminpanel/app/bower_components/ace-builds/src/mode-twig.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-typescript.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-vala.js on lines 874..912
          samples/adminpanel/app/bower_components/ace-builds/src/mode-velocity.js on lines 357..395
          samples/adminpanel/app/bower_components/ace-builds/src/mode-yaml.js on lines 82..120

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

          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