adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

        var lookAhead = function(match) {
            var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
            if (matches)
                iFormat++;
            return matches;
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.datepicker.js on lines 1181..1186

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

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 _detachListners() {
        MainViewManager.off("workingSetMove.pane-first-pane", _handleWorkingSetMove);
        MainViewManager.off("currentFileChange", handleCurrentFileChange);
        MainViewManager.off("paneDestroy", _handlePaneMerge);
        EditorManager.off("activeEditorChange", _handleActiveEditorChange);
Severity: Major
Found in src/extensions/default/NavigationAndHistory/main.js and 1 other location - About 1 hr to fix
src/extensions/default/NavigationAndHistory/main.js on lines 798..804

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

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

            if (!_.isEqual(section[id], value)) {
                if (value === undefined) {
                    delete section[id];
                } else {
                    section[id] = _.cloneDeep(value);
Severity: Major
Found in src/preferences/PreferencesBase.js and 1 other location - About 1 hr to fix
src/preferences/PreferencesBase.js on lines 668..675

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

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 ( oRange === "min" && this.orientation === "horizontal" ) {
                this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { width: valPercent + "%" }, o.animate );
            }
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.slider.js on lines 625..627

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

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 ( oRange === "min" && this.orientation === "vertical" ) {
                this.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { height: valPercent + "%" }, o.animate );
            }
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.slider.js on lines 619..621

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

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

        var lookAhead = function(match) {
            var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);
            if (matches)
                iFormat++;
            return matches;
src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/ui/jquery.ui.datepicker.js on lines 1007..1012

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

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 init has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function init(domainManager) {
    _domainManager = domainManager;

    if (!domainManager.hasDomain("OpenWithExternalApplication")) {
        domainManager.registerDomain("OpenWithExternalApplication", {major: 0, minor: 1});

    Function initiateAutoUpdate has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function initiateAutoUpdate(updateParams) {
            _updateParams = updateParams;
            downloadAttemptsRemaining = MAX_DOWNLOAD_ATTEMPTS;
    
            initializeState()
    Severity: Minor
    Found in src/extensions/default/AutoUpdate/main.js - About 1 hr to fix

      Function restoreLineFolds has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function restoreLineFolds(editor) {
              /**
               * Checks if the range from and to Pos is the same as the selection start and end Pos
               * @param   {Object}  range     {from, to} where from and to are CodeMirror.Pos objects
               * @param   {Object}  selection {start, end} where start and end are CodeMirror.Pos objects
      Severity: Minor
      Found in src/extensions/default/CodeFolding/main.js - About 1 hr to fix

        Function _handleListEvents has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function _handleListEvents() {
                $dropdown
                    .on("click", "a", function () {
                        var $link = $(this),
                            id    = $link.attr("id"),
        Severity: Minor
        Found in src/extensions/default/RecentProjects/main.js - About 1 hr to fix

          Function refresh has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              refresh: function() {
                  var maxHeight, overflow,
                      heightStyle = this.options.heightStyle,
                      parent = this.element.parent();
          
          

            Function _eventHandler has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _eventHandler: function( event ) {
                    var options = this.options,
                        active = this.active,
                        clicked = $( event.currentTarget ),
                        clickedIsActive = clicked[ 0 ] === active[ 0 ],

              Function exports has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function( grunt ) {
              
              grunt.registerTask( "testswarm", function( commit, configFile ) {
                  var test,
                      testswarm = require( "testswarm" ),

                Function setup has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    setup: function() {
                        if ( this.module !== config.previousModule ) {
                            if ( config.previousModule ) {
                                runLoggingCallbacks( "moduleDone", QUnit, {
                                    name: config.previousModule,

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

                      init: function() {
                          extend( config, {
                              stats: { all: 0, bad: 0 },
                              moduleStats: { all: 0, bad: 0 },
                              started: +new Date(),

                    Function attachHandlers has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function attachHandlers() {
                    
                            function handleDragOver(event) {
                                event = event.originalEvent || event;
                    
                    
                    Severity: Minor
                    Found in src/utils/DragAndDrop.js - About 1 hr to fix

                      Function concatFactory has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function concatFactory(iterable, values) {
                          var isKeyedIterable = isKeyed(iterable);
                          var iters = [iterable].concat(values).map(function(v ) {
                            if (!isIterable(v)) {
                              v = isKeyedIterable ?
                      Severity: Minor
                      Found in src/thirdparty/immutable.js - About 1 hr to fix

                        Function filterFactory has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function filterFactory(iterable, predicate, context, useKeys) {
                            var filterSequence = makeSequence(iterable);
                            if (useKeys) {
                              filterSequence.has = function(key ) {
                                var v = iterable.get(key, NOT_SET);
                        Severity: Minor
                        Found in src/thirdparty/immutable.js - About 1 hr to fix

                          Function exports has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = function (grunt) {
                              var common  = require("./lib/common")(grunt),
                                  build   = require("./build")(grunt);
                          
                              // task: write-config
                          Severity: Minor
                          Found in tasks/write-config.js - About 1 hr to fix

                            Function _updateTitle has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function _updateTitle() {
                                    var currentDoc          = DocumentManager.getCurrentDocument(),
                                        windowTitle         = brackets.config.app_title,
                                        currentlyViewedFile = MainViewManager.getCurrentlyViewedFile(MainViewManager.ACTIVE_PANE),
                                        currentlyViewedPath = currentlyViewedFile && currentlyViewedFile.fullPath,
                            Severity: Minor
                            Found in src/document/DocumentCommandHandlers.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language