kuasha/cosmos

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

Summary

Maintainability
F
1 wk
Test Coverage

Function ClojureHighlightRules has 146 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var ClojureHighlightRules = function() {

    var builtinFunctions = (
        '* *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* ' +
        '*command-line-args* *compile-files* *compile-path* *e *err* *file* ' +

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

    define("ace/mode/clojure_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;

      Function $calculateIndent has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          this.$calculateIndent = function(line, tab) {
              var baseIndent = this.$getIndent(line);
              var delta = 0;
              var isParen, ch;
              for (var i = line.length - 1; i >= 0; i--) {

        Avoid too many return statements within this function.
        Open

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

          Avoid too many return statements within this function.
          Open

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

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

            define("ace/mode/clojure",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/clojure_highlight_rules","ace/mode/matching_parens_outdent"], function(require, exports, module) {
            "use strict";
            
            var oop = require("../lib/oop");
            var TextMode = require("./text").Mode;
            samples/adminpanel/app/bower_components/ace-builds/src-noconflict/mode-clojure.js on lines 214..306

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

            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/clojure_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-noconflict/mode-clojure.js on lines 1..167

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

            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/matching_parens_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-noconflict/mode-clojure.js on lines 169..212

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

            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