kuasha/cosmos

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

Summary

Maintainability
F
1 mo
Test Coverage

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

ace.define("ace/ext/menu_tools/element_generator",["require","exports","module"], function(require, exports, module) {
'use strict';
module.exports.createOption = function createOption (obj) {
    var attribute;
    var el = document.createElement('option');

    Function generateSettingsMenu has 107 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports.generateSettingsMenu = function generateSettingsMenu (editor) {
        var elements = [];
        function cleanupElementsList() {
            elements.sort(function(a, b) {
                var x = a.getAttribute('contains');

      Function createNewEntry has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function createNewEntry(obj, clss, item, val) {
              var el;
              var div = document.createElement('div');
              div.setAttribute('contains', item);
              div.setAttribute('class', 'ace_optionsMenuEntry');

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

        module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) {
            var modelist = require('../modelist');
            var themelist = require('../themelist');
            editor.menuOptions = {
                setNewLineMode: [{

          Function overlayPage has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) {
              top = top ? 'top: ' + top + ';' : '';
              bottom = bottom ? 'bottom: ' + bottom + ';' : '';
              right = right ? 'right: ' + right + ';' : '';
              left = left ? 'left: ' + left + ';' : '';

            Function getSetFunctions has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports.getSetFunctions = function getSetFunctions (editor) {
                var out = [];
                var my = {
                    'editor' : editor,
                    'session' : editor.session,

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

              module.exports.overlayPage = function overlayPage(editor, contentElement, top, right, bottom, left) {

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

                ace.define("ace/ext/modelist",["require","exports","module"], function(require, exports, module) {
                "use strict";
                
                var modes = [];
                function getModeForPath(path) {
                samples/adminpanel/app/bower_components/ace-builds/src-noconflict/ext-modelist.js on lines 1..173

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

                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

                ace.define("ace/ext/menu_tools/generate_settings_menu",["require","exports","module","ace/ext/menu_tools/element_generator","ace/ext/menu_tools/add_editor_menu_options","ace/ext/menu_tools/get_set_functions"], function(require, exports, module) {
                'use strict';
                var egen = require('./element_generator');
                var addEditorMenuOptions = require('./add_editor_menu_options').addEditorMenuOptions;
                var getSetFunctions = require('./get_set_functions').getSetFunctions;
                samples/adminpanel/app/bower_components/ace-builds/src/ext-settings_menu.js on lines 382..499

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

                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

                ace.define("ace/ext/menu_tools/element_generator",["require","exports","module"], function(require, exports, module) {
                'use strict';
                module.exports.createOption = function createOption (obj) {
                    var attribute;
                    var el = document.createElement('option');
                samples/adminpanel/app/bower_components/ace-builds/src/ext-settings_menu.js on lines 1..55

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

                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

                ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"], function(require, exports, module) {
                'use strict';
                var dom = require("../../lib/dom");
                var cssText = "#ace_settingsmenu, #kbshortcutmenu {\
                background-color: #F7F7F7;\
                samples/adminpanel/app/bower_components/ace-builds/src-noconflict/ext-keybinding_menu.js on lines 1..100

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

                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

                ace.define("ace/ext/themelist",["require","exports","module","ace/lib/fixoldbrowsers"], function(require, exports, module) {
                "use strict";
                require("ace/lib/fixoldbrowsers");
                
                var themeData = [
                samples/adminpanel/app/bower_components/ace-builds/src-noconflict/ext-themelist.js on lines 1..54

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

                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

                ace.define("ace/ext/menu_tools/add_editor_menu_options",["require","exports","module","ace/ext/modelist","ace/ext/themelist"], function(require, exports, module) {
                'use strict';
                module.exports.addEditorMenuOptions = function addEditorMenuOptions (editor) {
                    var modelist = require('../modelist');
                    var themelist = require('../themelist');
                samples/adminpanel/app/bower_components/ace-builds/src/ext-settings_menu.js on lines 286..338

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

                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

                ace.define("ace/ext/menu_tools/get_set_functions",["require","exports","module"], function(require, exports, module) {
                'use strict';
                module.exports.getSetFunctions = function getSetFunctions (editor) {
                    var out = [];
                    var my = {
                samples/adminpanel/app/bower_components/ace-builds/src/ext-settings_menu.js on lines 340..380

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

                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

                ace.define("ace/ext/settings_menu",["require","exports","module","ace/ext/menu_tools/generate_settings_menu","ace/ext/menu_tools/overlay_page","ace/editor"], function(require, exports, module) {
                "use strict";
                var generateSettingsMenu = require('./menu_tools/generate_settings_menu').generateSettingsMenu;
                var overlayPage = require('./menu_tools/overlay_page').overlayPage;
                function showSettingsMenu(editor) {
                samples/adminpanel/app/bower_components/ace-builds/src/ext-settings_menu.js on lines 602..617

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

                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