kuasha/cosmos

View on GitHub
samples/adminpanel/app/bower_components/ace-builds/src-noconflict/ext-textarea.js

Summary

Maintainability
F
3 wks
Test Coverage

File ext-textarea.js has 567 lines of code (exceeds 250 allowed). Consider refactoring.
Open

ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
"use strict";

exports.isDark = false;
exports.cssClass = "ace-tm";

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

    function setupSettingPanel(settingDiv, settingOpener, editor) {
        var BOOL = null;
    
        var desc = {
            mode:            "Mode:",

      Function transformTextarea has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.transformTextarea = function(element, options) {
          var session;
          var container = setupContainer(element, function() {
              return session.getValue();
          });

        Function setupApi has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function setupApi(editor, editorDiv, settingDiv, ace, options, loader) {
            var session = editor.getSession();
            var renderer = editor.renderer;
            loader = loader || load;
        
        

          Function setupContainer has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function setupContainer(element, getValue) {
              if (element.type != 'textarea') {
                  throw new Error("Textarea required!");
              }
          
          

            Function setOption has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                editor.setOption = function(key, value) {
                    switch (key) {
                        case "mode":
                            editor.$setOption("mode", "ace/mode/" + value)
                        break;

              Function setupApi has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function setupApi(editor, editorDiv, settingDiv, ace, options, loader) {

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

                ace.define("ace/ext/textarea",["require","exports","module","ace/lib/event","ace/lib/useragent","ace/lib/net","ace/ace","ace/theme/textmate"], function(require, exports, module) {
                "use strict";
                
                var event = require("../lib/event");
                var UA = require("../lib/useragent");
                samples/adminpanel/app/bower_components/ace-builds/src/ext-textarea.js on lines 192..616

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

                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

                ace.define("ace/ace",["require","exports","module","ace/lib/fixoldbrowsers","ace/lib/dom","ace/lib/event","ace/editor","ace/edit_session","ace/undomanager","ace/virtual_renderer","ace/worker/worker_client","ace/keyboard/hash_handler","ace/placeholder","ace/multi_select","ace/mode/folding/fold_mode","ace/theme/textmate","ace/ext/error_marker","ace/config"], function(require, exports, module) {
                "use strict";
                
                require("./lib/fixoldbrowsers");
                
                
                samples/adminpanel/app/bower_components/ace-builds/src/ext-textarea.js on lines 132..190

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

                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

                ace.define("ace/theme/textmate",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
                "use strict";
                
                exports.isDark = false;
                exports.cssClass = "ace-tm";
                samples/adminpanel/app/bower_components/ace-builds/src-noconflict/theme-eclipse.js on lines 1..98
                samples/adminpanel/app/bower_components/ace-builds/src-noconflict/theme-textmate.js on lines 1..130

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

                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