kuasha/cosmos

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

Summary

Maintainability
F
3 wks
Test Coverage

Function LuaHighlightRules has 134 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var LuaHighlightRules = function() {

    var keywords = (
        "break|do|else|elseif|end|for|function|if|in|local|repeat|"+
         "return|then|until|while|or|and|not"
Severity: Major
Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-lua.js - About 5 hrs to fix

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

    define("ace/mode/lua_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-lua.js - About 4 hrs to fix

      Function luaBlock has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.luaBlock = function(session, row, column) {
              var stream = new TokenIterator(session, row, column);
              var indentKeywords = {
                  "function": 1,
                  "do": 1,
      Severity: Minor
      Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-lua.js - About 1 hr to fix

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

            this.getFoldWidget = function(session, foldStyle, row) {
                var line = session.getLine(row);
                var isStart = this.foldingStartMarker.test(line);
                var isEnd = this.foldingStopMarker.test(line);
        
        
        Severity: Minor
        Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-lua.js - About 1 hr to fix

          Avoid too many return statements within this function.
          Open

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

            Avoid too many return statements within this function.
            Open

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

              Avoid too many return statements within this function.
              Open

                              return "end";
              Severity: Major
              Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-lua.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-lua.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return this.closingBracketBlock(session, "}", row, match.index + match[0].length);
                  Severity: Major
                  Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-lua.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return session.getCommentFoldRange(row, match.index + 1);
                    Severity: Major
                    Found in samples/adminpanel/app/bower_components/ace-builds/src/mode-lua.js - About 30 mins to fix

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

                      define("ace/mode/folding/lua",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range","ace/token_iterator"], 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-luapage.js on lines 2472..2604

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

                      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

                      define("ace/mode/lua",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/lua_highlight_rules","ace/mode/folding/lua","ace/range","ace/worker/worker_client"], 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-luapage.js on lines 2606..2735

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

                      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

                      define("ace/mode/lua_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-luapage.js on lines 2310..2470

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

                      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