adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

    function _addPos(pos1, pos2) {
        return {line: pos1.line + pos2.line, ch: (pos2.line === 0 ? pos1.ch + pos2.ch : pos2.ch)};
    }
Severity: Major
Found in src/language/HTMLSimpleDOM.js and 1 other location - About 1 hr to fix
src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js on lines 211..213

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

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

    function _moveWorkingSetItem(paneId, fromIndex, toIndex) {
        var pane = _getPane(paneId);

        pane.moveWorkingSetItem(fromIndex, toIndex);
        exports.trigger("workingSetSort", pane.id);
Severity: Major
Found in src/view/MainViewManager.js and 1 other location - About 1 hr to fix
src/view/MainViewManager.js on lines 919..925

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

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

    function _addPos(pos1, pos2) {
        return {line: pos1.line + pos2.line, ch: (pos2.line === 0 ? pos1.ch + pos2.ch : pos2.ch)};
    }
src/language/HTMLSimpleDOM.js on lines 246..248

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

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

        if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_UP ) {
            this._activate( this._focusNextTab( this.options.active - 1, false ) );
            return true;
        }
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.tabs.js on lines 226..229

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

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

                case 34: $.datepicker._adjustDate(event.target, (event.ctrlKey ?
                            +$.datepicker._get(inst, 'stepBigMonths') :
                            +$.datepicker._get(inst, 'stepMonths')), 'M');
                        break; // next month/year on page down/+ ctrl
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.datepicker.js on lines 550..553

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

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

            } else if (event.shiftKey &&
                    (event.keyCode === KeyEvent.DOM_VK_UP ||
                     event.keyCode === KeyEvent.DOM_VK_DOWN ||
                     event.keyCode === KeyEvent.DOM_VK_PAGE_UP ||
                     event.keyCode === KeyEvent.DOM_VK_PAGE_DOWN)) {
Severity: Major
Found in src/widgets/InlineMenu.js and 1 other location - About 1 hr to fix
src/editor/CodeHintList.js on lines 422..468

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

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

        if ( event.altKey && event.keyCode === $.ui.keyCode.PAGE_DOWN ) {
            this._activate( this._focusNextTab( this.options.active + 1, true ) );
            return true;
        }
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.tabs.js on lines 222..225

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

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

Function _handleSoftTabNavigation has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    Editor.prototype._handleSoftTabNavigation = function (direction, functionName) {
        var instance = this._codeMirror,
            overallJump = null;

        if (!instance.getOption("indentWithTabs") && PreferencesManager.get(SOFT_TABS)) {
Severity: Minor
Found in src/editor/Editor.js - About 1 hr to fix

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

    function init(domainManager) {
        if (!domainManager.hasDomain("TernNodeDomain")) {
            domainManager.registerDomain("TernNodeDomain", {major: 0, minor: 1});
        }
    
    
    Severity: Minor
    Found in src/JSUtils/node/TernNodeDomain.js - About 1 hr to fix

      Function NetworkAgent has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      define(function NetworkAgent(require, exports, module) {
          "use strict";
      
          var Inspector = require("LiveDevelopment/Inspector/Inspector");
      
      
      Severity: Minor
      Found in src/LiveDevelopment/Agents/NetworkAgent.js - About 1 hr to fix

        Function ConsoleAgent has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        define(function ConsoleAgent(require, exports, module) {
            "use strict";
        
            var Inspector = require("LiveDevelopment/Inspector/Inspector");
        
        
        Severity: Minor
        Found in src/LiveDevelopment/Agents/ConsoleAgent.js - About 1 hr to fix

          Function it has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  function it(type, value) {
                      var i, t;
                      if (type === '(color)' || type === '(range)') {
                          t = {type: type};
                      } else if (type === '(punctuator)' ||

            Function _wrapSelectedStatements has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function _wrapSelectedStatements (wrapperName, err) {
                    var editor = EditorManager.getActiveEditor();
                    if (!editor) {
                        return;
                    }
            Severity: Minor
            Found in src/extensions/default/JavaScriptRefactoring/WrapSelection.js - About 1 hr to fix

              Function _getPrefType has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _getPrefType(prefItem) {
              
                      var finalPrefType = "undefined";
              
                      if (prefItem) {
              Severity: Minor
              Found in src/extensions/default/DebugCommands/main.js - About 1 hr to fix

                Function setDirectoryOpen has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ProjectModel.prototype.setDirectoryOpen = function (path, open) {
                        var projectRelative = this.makeProjectRelativeIfPossible(path),
                            needsLoading    = !this._viewModel.isPathLoaded(projectRelative),
                            d               = new $.Deferred(),
                            self            = this;
                Severity: Minor
                Found in src/project/ProjectModel.js - About 1 hr to fix

                  Function watchPath has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function watchPath(path, ignored, _watcherMap) {
                      try {
                          var watcher = chokidar.watch(path, {
                              persistent: true,
                              ignoreInitial: true,
                  Severity: Minor
                  Found in src/filesystem/impls/appshell/node/ChokidarWatcher.js - About 1 hr to fix

                    Function flattenFactory has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function flattenFactory(iterable, depth, useKeys) {
                        var flatSequence = makeSequence(iterable);
                        flatSequence.__iterateUncached = function(fn, reverse) {
                          var iterations = 0;
                          var stopped = false;
                    Severity: Minor
                    Found in src/thirdparty/immutable.js - About 1 hr to fix

                      Function showDropdown has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          DropdownButton.prototype.showDropdown = function () {
                              // Act like a plain old button if no items to show
                              if (!this.items.length) {
                                  return;
                              }
                      Severity: Minor
                      Found in src/widgets/DropdownButton.js - About 1 hr to fix

                        Function _handleOtherRuntime has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function _handleOtherRuntime(serverOptions) {
                                function _getArguments(sOptions) {
                                    var args = [];
                        
                                    if (sOptions.options && sOptions.options.execArgv) {
                        Severity: Minor
                        Found in src/languageTools/LanguageClient/ServerUtils.js - About 1 hr to fix

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

                              Command.prototype.setEnabled = function (enabled) {
                                  var changed = this._enabled !== enabled;
                                  this._enabled = enabled;
                          
                                  if (changed) {
                          Severity: Major
                          Found in src/command/CommandManager.js and 2 other locations - About 1 hr to fix
                          src/command/CommandManager.js on lines 130..137
                          src/command/CommandManager.js on lines 157..164

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language