kuasha/cosmos

View on GitHub
samples/adminpanel/app/bower_components/ace-builds/src-noconflict/keybinding-emacs.js

Summary

Maintainability
F
1 mo
Test Coverage

File keybinding-emacs.js has 947 lines of code (exceeds 250 allowed). Consider refactoring.
Open

ace.define("ace/occur",["require","exports","module","ace/lib/oop","ace/range","ace/search","ace/edit_session","ace/search_highlight","ace/lib/dom"], function(require, exports, module) {
"use strict";

var oop = require("./lib/oop");
var Range = require("./range").Range;

    Function handleKeyboard has 72 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
        if (keyCode === -1) return undefined;
    
        var editor = data.editor;
        if (hashId == -1) {

      Function attach has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      exports.handler.attach = function(editor) {
          if (!initialized) {
              initialized = true;
              dom.importCssString('\
                  .emacs-mode .ace_cursor{\

        Avoid too many return statements within this function.
        Open

            if (command === "null") return {command: "null"};

          Avoid too many return statements within this function.
          Open

                  if (!command) return undefined;

            Avoid too many return statements within this function.
            Open

                        return {
                            args: args,
                            command: {
                                exec: function(editor, args) {
                                    for (var i = 0; i < count; i++)

              Avoid too many return statements within this function.
              Open

                  return {command: command, args: args};

                Avoid too many return statements within this function.
                Open

                    if (!command) return undefined;

                  Avoid too many return statements within this function.
                  Open

                          return {command: "null"};

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

                    ace.define("ace/keyboard/emacs",["require","exports","module","ace/lib/dom","ace/incremental_search","ace/commands/incremental_search_commands","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) {
                    "use strict";
                    
                    var dom = require("../lib/dom");
                    require("../incremental_search");
                    samples/adminpanel/app/bower_components/ace-builds/src/keybinding-emacs.js on lines 557..1070

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

                    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