BabylonJS/Spector.js

View on GitHub
vendors/ace-ext-searchbox.js

Summary

Maintainability
D
3 days
Test Coverage

File ace-ext-searchbox.js has 482 lines of code (exceeds 250 allowed). Consider refactoring.
Open

ace.define("ace/ext/searchbox",["require","exports","module","ace/lib/dom","ace/lib/lang","ace/lib/event","ace/keyboard/hash_handler","ace/lib/keys"], function(require, exports, module) {
"use strict";

var dom = require("../lib/dom");
var lang = require("../lib/lang");
Severity: Minor
Found in vendors/ace-ext-searchbox.js - About 7 hrs to fix

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

        this.$init = function() {
            var sb = this.element;
            
            this.$initElements(sb);
            
    Severity: Minor
    Found in vendors/ace-ext-searchbox.js - About 1 hr to fix

      Function SearchBox has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var SearchBox = function(editor, range, showReplaceForm) {
          var div = dom.createElement("div");
          dom.buildDom(["div", {class:"ace_search right"},
              ["span", {action: "hide", class: "ace_searchbtn_close"}],
              ["div", {class: "ace_search_form"},
      Severity: Minor
      Found in vendors/ace-ext-searchbox.js - About 1 hr to fix

        Function updateCounter has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            this.updateCounter = function() {
                var editor = this.editor;
                var regex = editor.$search.$options.re;
                var all = 0;
                var before = 0;
        Severity: Minor
        Found in vendors/ace-ext-searchbox.js - About 1 hr to fix

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

              }, {
                  name: "toggleCaseSensitive",
                  bindKey: {win: "Alt-C|Alt-I", mac: "Ctrl-Alt-R|Ctrl-Alt-I"},
                  exec: function(sb) {
                      sb.caseSensitiveOption.checked = !sb.caseSensitiveOption.checked;
          Severity: Major
          Found in vendors/ace-ext-searchbox.js and 2 other locations - About 1 hr to fix
          vendors/ace-ext-searchbox.js on lines 323..330
          vendors/ace-ext-searchbox.js on lines 337..344

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

          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

              this.$searchBarKb.addCommands([{
                  name: "toggleRegexpMode",
                  bindKey: {win: "Alt-R|Alt-/", mac: "Ctrl-Alt-R|Ctrl-Alt-/"},
                  exec: function(sb) {
                      sb.regExpOption.checked = !sb.regExpOption.checked;
          Severity: Major
          Found in vendors/ace-ext-searchbox.js and 2 other locations - About 1 hr to fix
          vendors/ace-ext-searchbox.js on lines 330..337
          vendors/ace-ext-searchbox.js on lines 337..344

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

          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

              }, {
                  name: "toggleWholeWords",
                  bindKey: {win: "Alt-B|Alt-W", mac: "Ctrl-Alt-B|Ctrl-Alt-W"},
                  exec: function(sb) {
                      sb.wholeWordOption.checked = !sb.wholeWordOption.checked;
          Severity: Major
          Found in vendors/ace-ext-searchbox.js and 2 other locations - About 1 hr to fix
          vendors/ace-ext-searchbox.js on lines 323..330
          vendors/ace-ext-searchbox.js on lines 330..337

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

          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

          });                (function() {
                              ace.require(["ace/ext/searchbox"], function(m) {
                                  if (typeof module == "object" && typeof exports == "object" && module) {
                                      module.exports = m;
                                  }
          Severity: Major
          Found in vendors/ace-ext-searchbox.js and 2 other locations - About 1 hr to fix
          vendors/ace-mode-glsl.js on lines 572..578
          vendors/ace-theme-monokai.js on lines 105..111

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

          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

                  event.addListener(this.searchInput, "focus", function() {
                      _this.activeInput = _this.searchInput;
                      _this.searchInput.value && _this.highlight();
                  });
          Severity: Major
          Found in vendors/ace-ext-searchbox.js and 1 other location - About 1 hr to fix
          vendors/ace-ext-searchbox.js on lines 266..269

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

          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

                  event.addListener(this.replaceInput, "focus", function() {
                      _this.activeInput = _this.replaceInput;
                      _this.searchInput.value && _this.highlight();
                  });
          Severity: Major
          Found in vendors/ace-ext-searchbox.js and 1 other location - About 1 hr to fix
          vendors/ace-ext-searchbox.js on lines 262..265

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

          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

              this.replace = function() {
                  if (!this.editor.getReadOnly())
                      this.editor.replace(this.replaceInput.value);
              };    
          Severity: Major
          Found in vendors/ace-ext-searchbox.js and 1 other location - About 1 hr to fix
          vendors/ace-ext-searchbox.js on lines 463..466

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

          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

              this.replaceAll = function() {
                  if (!this.editor.getReadOnly())
                      this.editor.replaceAll(this.replaceInput.value);
              };
          Severity: Major
          Found in vendors/ace-ext-searchbox.js and 1 other location - About 1 hr to fix
          vendors/ace-ext-searchbox.js on lines 453..456

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

          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

                  "Alt-Return": function(sb) {
                      if (sb.activeInput == sb.replaceInput)
                          sb.replaceAll();
                      sb.findAll();
                  },
          Severity: Minor
          Found in vendors/ace-ext-searchbox.js and 2 other locations - About 35 mins to fix
          vendors/ace-ext-searchbox.js on lines 303..307
          vendors/ace-ext-searchbox.js on lines 308..312

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

          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

                  "Shift-Return": function(sb) {
                      if (sb.activeInput == sb.replaceInput)
                          sb.replace();
                      sb.findPrev();
                  },
          Severity: Minor
          Found in vendors/ace-ext-searchbox.js and 2 other locations - About 35 mins to fix
          vendors/ace-ext-searchbox.js on lines 303..307
          vendors/ace-ext-searchbox.js on lines 313..317

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

          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

                  "Return": function(sb) {
                      if (sb.activeInput == sb.replaceInput)
                          sb.replace();
                      sb.findNext();
                  },
          Severity: Minor
          Found in vendors/ace-ext-searchbox.js and 2 other locations - About 35 mins to fix
          vendors/ace-ext-searchbox.js on lines 308..312
          vendors/ace-ext-searchbox.js on lines 313..317

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

          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