adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

    domainManager.registerCommand(
        "launcher",      // domain name
        "launch",       // command name
        _cmdLaunch,     // command handler function
        false,          // this command is synchronous in Node
src/LiveDevelopment/MultiBrowserImpl/transports/node/NodeSocketTransportDomain.js on lines 196..207

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

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

                results[testFolder + "test/test2.php"] = {matches: [
                    {
                        start: {line: 27, ch: 0},
                        end: {line: 27, ch: 18},
                        line: "watchparameterhint()"
Severity: Major
Found in src/extensions/default/PhpTooling/unittests.js and 1 other location - About 1 hr to fix
src/extensions/default/PhpTooling/unittests.js on lines 657..664

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

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

            it("should show preview of valid hsl/hsla colors", function () {
                runs(function () {
                    checkColorAtPos("hsl(0, 100%, 50%)",       31, 22);
                    checkColorAtPos("hsla(0, 100%, 50%, 0.5)", 32, 23);
                    checkColorAtPos("hsla(0, 100%, 50%, .5)",  33, 23);
Severity: Major
Found in src/extensions/default/QuickView/unittests.js and 1 other location - About 1 hr to fix
src/extensions/default/QuickView/unittests.js on lines 440..447

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

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

    domainManager.registerCommand(
        "nodeSocketTransport",      // domain name
        "send",         // command name
        _cmdSend,       // command handler function
        false,          // this command is synchronous in Node
src/LiveDevelopment/MultiBrowserImpl/launchers/node/LauncherDomain.js on lines 56..67

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

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

            it("Should show image preview for file path inside url()", function () {
                runs(function () {
                    checkImagePathAtPos("img/grabber_color-well.png", 140, 26);
                    checkImagePathAtPos("img/Color.png",              141, 26);
                    checkImagePathAtPos("img/throbber.gif",           142, 26);
Severity: Major
Found in src/extensions/default/QuickView/unittests.js and 1 other location - About 1 hr to fix
src/extensions/default/QuickView/unittests.js on lines 162..169

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

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

                results[testFolder + "test/test3.php"] = {matches: [
                    {
                        start: {line: 11, ch: 0},
                        end: {line: 11, ch: 26},
                        line: "watchReferences();"
Severity: Major
Found in src/extensions/default/PhpTooling/unittests.js and 1 other location - About 1 hr to fix
src/extensions/default/PhpTooling/unittests.js on lines 587..594

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

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

    function install(path, nameHint, _doUpdate) {
        return _extensionManagerCall(function (extensionManager) {
            var d                       = new $.Deferred(),
                destinationDirectory    = ExtensionLoader.getUserExtensionPath(),
                disabledDirectory       = destinationDirectory.replace(/\/user$/, "/disabled"),
Severity: Minor
Found in src/extensibility/Package.js - About 1 hr to fix

    Function show has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        InstallExtensionDialog.prototype.show = function (urlToInstall) {
            if (this._state !== STATE_CLOSED) {
                // Somehow the dialog got invoked twice. Just ignore this.
                return this._dialogDeferred.promise();
            }
    Severity: Minor
    Found in src/extensibility/InstallExtensionDialog.js - About 1 hr to fix

      Function hasHtmlHints has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          UrlCodeHints.prototype.hasHtmlHints = function (editor, implicitChar) {
              var tagInfo,
                  query,
                  tokenType;
      
      
      Severity: Minor
      Found in src/extensions/default/UrlCodeHints/main.js - About 1 hr to fix

        Function _updateDatepicker has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _updateDatepicker: function(inst) {
                this.maxRows = 4; //Reset the max number of rows being displayed (see #7043)
                var borders = $.datepicker._getBorders(inst.dpDiv);
                instActive = inst; // for delegate hover events
                inst.dpDiv.empty().append(this._generateHTML(inst));

          Function _destroy has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _destroy: function() {
                  var contents;
          
                  // clean up main element
                  this.element

            Function left has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    left: function( position, data ) {
                        var within = data.within,
                            withinOffset = within.offset.left + within.scrollLeft,
                            outerWidth = within.width,
                            offsetLeft = within.isWindow ? 0 : within.offset.left,

              Function _normalizeArguments has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function _normalizeArguments( effect, options, speed, callback ) {
              
                  // allow passing all optinos as the first parameter
                  if ( $.isPlainObject( effect ) ) {
                      options = effect;

                Function ATTR has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        ATTR: function( elem, match ) {
                            var name = match[1],
                                result = Sizzle.attr ?
                                    Sizzle.attr( elem, name ) :
                                    Expr.attrHandle[ name ] ?

                  Function setOffset has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      setOffset: function( elem, options, i ) {
                          var position = jQuery.css( elem, "position" );
                  
                          // set position first, in-case top/left are set even on static elem
                          if ( position === "static" ) {

                    Function registerHandlersAndDomains has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            function registerHandlersAndDomains(ws, port) {
                                // Called if we succeed at the final setup
                                function success() {
                                    self._ws.onclose = function () {
                                        if (self._autoReconnect) {
                    Severity: Minor
                    Found in src/utils/NodeConnection.js - About 1 hr to fix

                      Function on has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var on = function (events, fn) {
                              var eventsList = events.split(/\s+/).map(splitNs),
                                  i;
                      
                              if (!fn) {
                      Severity: Minor
                      Found in src/utils/EventDispatcher.js - About 1 hr to fix

                        Function _setDirectoryOpen has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function _setDirectoryOpen(treeData, path, open) {
                                var objectPath = _filePathToObjectPath(treeData, path),
                                    directory = treeData.getIn(objectPath);
                        
                                if (!objectPath) {
                        Severity: Minor
                        Found in src/project/FileTreeViewModel.js - About 1 hr to fix

                          Function _sendData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  function _sendData(fileSize) {
                                      var subType = "";
                          
                                      if(fileSize/1024 <= 1) {
                          
                          
                          Severity: Minor
                          Found in src/utils/HealthLogger.js - About 1 hr to fix

                            Function waitForAll has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function waitForAll(promises, failOnReject, timeout) {
                                    var masterDeferred = new $.Deferred(),
                                        results = [],
                                        count = 0,
                                        sawRejects = false;
                            Severity: Minor
                            Found in src/utils/Async.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language