adobe/brackets

View on GitHub

Showing 3,294 of 3,294 total issues

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

            it("should list hints between tag name and attribute name (space on both sides of cursor)", function () {
                testDocument.replaceRange(" ", { line: 5, ch: 5 });  // insert a space: "<h1 id" -> "<h1  id"

                testEditor.setCursorPos({ line: 5, ch: 6 });   // cursor between two spaces, which are between end of tag name ("p") and start of attribute name
                var hintList = expectHints(HTMLCodeHints.attrHintProvider);
Severity: Major
Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 2 hrs to fix
src/extensions/default/HTMLCodeHints/unittests.js on lines 250..256

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

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 list hints between prev attribute value and next attribute name (space on both sides of cursor)", function () {
                testDocument.replaceRange(" ", { line: 8, ch: 14 });  // insert a space: "'aaa' class" -> "'aaa'  class"

                testEditor.setCursorPos({ line: 8, ch: 15 });   // cursor between two spaces, which are between end of attribute value ("p") and start of attribute name
                var hintList = expectHints(HTMLCodeHints.attrHintProvider);
Severity: Major
Found in src/extensions/default/HTMLCodeHints/unittests.js and 1 other location - About 2 hrs to fix
src/extensions/default/HTMLCodeHints/unittests.js on lines 243..249

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

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

    function inlineProvider(hostEditor, pos) {
        var jsonFile, propInfo,
            propQueue = [], // priority queue of propNames to try
            langId = hostEditor.getLanguageForSelection().getId(),
            supportedLangs = {
Severity: Major
Found in src/extensions/default/MDNDocs/main.js - About 2 hrs to fix

    Function _showDatepicker has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _showDatepicker: function(input) {
            input = input.target || input;
            if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
                input = $('input', input.parentNode)[0];
            if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here

      Function _mouseDrag has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _mouseDrag: function(event) {
              var that = this;
              this.dragged = true;
      
              if (this.options.disabled)

        Function done has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                function done( status, nativeStatusText, responses, headers ) {
        
                    // Called once
                    if ( state === 2 ) {
                        return;

          Function filter has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Sizzle.filter = function( expr, set, inplace, not ) {
              var match, anyFound,
                  type, found, item, filter, left,
                  i, pass,
                  old = expr,

            Function getHints has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                SVGCodeHints.prototype.getHints = function (implicitChar) {
                    var hints = [], query, tagInfo, attributes = [], options = [], index, isMultiple, tagSpecificOptions;
            
                    tagInfo  = XMLUtils.getTagInfo(this.editor, this.editor.getCursorPos());
                    this.tagInfo = tagInfo;
            Severity: Major
            Found in src/extensions/default/SVGCodeHints/main.js - About 2 hrs to fix

              Function add has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  add: function( elem, types, handler, data, selector ) {
              
                      var handleObjIn, eventHandle, tmp,
                          events, t, handleObj,
                          special, handlers, type, namespaces, origType,
              Severity: Major
              Found in src/thirdparty/jquery-2.1.3.js - About 2 hrs to fix

                Function matcherFromGroupMatchers has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
                    var bySet = setMatchers.length > 0,
                        byElement = elementMatchers.length > 0,
                        superMatcher = function( seed, context, xml, results, outermost ) {
                            var elem, j, matcher,
                Severity: Major
                Found in src/thirdparty/jquery-2.1.3.js - About 2 hrs to fix

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

                              it("should hint for src attribute", function () {
                                  runs(function () {
                                      testEditor.setCursorPos({ line: 15, ch: 13 });
                                      hintsObj = null;
                                      expectAsyncHints(UrlCodeHints.hintProvider);
                  Severity: Major
                  Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
                  src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
                  src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
                  src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
                  src/extensions/default/UrlCodeHints/unittests.js on lines 250..260
                  src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

                  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 (nexttoken.id !== ';') {
                              if (token.line === nexttoken.line) {
                                  if (funct[v] !== 'label') {
                                      warning("'{a}' is not a statement label.", nexttoken, v);
                                  } else if (scope[v] !== funct) {
                  src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/external/jshint.js on lines 3862..3874

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

                  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 6 locations. Consider refactoring.
                  Open

                              it("should hint for background-image: url()", function () {
                                  runs(function () {
                                      testEditor.setCursorPos({ line: 6, ch: 24 });
                                      hintsObj = null;
                                      expectAsyncHints(UrlCodeHints.hintProvider);
                  Severity: Major
                  Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
                  src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
                  src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
                  src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
                  src/extensions/default/UrlCodeHints/unittests.js on lines 250..260
                  src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

                  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 6 locations. Consider refactoring.
                  Open

                              it("should hint for list-style-image: url(\"\")", function () {
                                  runs(function () {
                                      testEditor.setCursorPos({ line: 8, ch: 25 });
                                      hintsObj = null;
                                      expectAsyncHints(UrlCodeHints.hintProvider);
                  Severity: Major
                  Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
                  src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
                  src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
                  src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
                  src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
                  src/extensions/default/UrlCodeHints/unittests.js on lines 250..260

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

                  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

                      function getTextNodeID(textNode) {
                          var childIndex = textNode.parent.children.indexOf(textNode);
                          if (childIndex === 0) {
                              return textNode.parent.tagID + ".0";
                          }
                  src/language/HTMLSimpleDOM.js on lines 233..239

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

                  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 (nexttoken.id !== ';') {
                              if (token.line === nexttoken.line) {
                                  if (funct[v] !== 'label') {
                                      warning("'{a}' is not a statement label.", nexttoken, v);
                                  } else if (scope[v] !== funct) {
                  src/extensions/default/JavaScriptQuickEdit/unittest-files/jquery-ui/external/jshint.js on lines 3837..3847

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

                  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 6 locations. Consider refactoring.
                  Open

                              it("should hint for poster attribute", function () {
                                  runs(function () {
                                      testEditor.setCursorPos({ line: 24, ch: 17 });
                                      hintsObj = null;
                                      expectAsyncHints(UrlCodeHints.hintProvider);
                  Severity: Major
                  Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
                  src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
                  src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
                  src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
                  src/extensions/default/UrlCodeHints/unittests.js on lines 250..260
                  src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

                  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 6 locations. Consider refactoring.
                  Open

                              it("should hint for @import url()", function () {
                                  runs(function () {
                                      testEditor.setCursorPos({ line: 4, ch: 12 });
                                      hintsObj = null;
                                      expectAsyncHints(UrlCodeHints.hintProvider);
                  Severity: Major
                  Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
                  src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
                  src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
                  src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
                  src/extensions/default/UrlCodeHints/unittests.js on lines 250..260
                  src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

                  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 6 locations. Consider refactoring.
                  Open

                              it("should hint for border-image: url('')", function () {
                                  runs(function () {
                                      testEditor.setCursorPos({ line: 7, ch: 21 });
                                      hintsObj = null;
                                      expectAsyncHints(UrlCodeHints.hintProvider);
                  Severity: Major
                  Found in src/extensions/default/UrlCodeHints/unittests.js and 5 other locations - About 2 hrs to fix
                  src/extensions/default/UrlCodeHints/unittests.js on lines 164..174
                  src/extensions/default/UrlCodeHints/unittests.js on lines 176..186
                  src/extensions/default/UrlCodeHints/unittests.js on lines 226..236
                  src/extensions/default/UrlCodeHints/unittests.js on lines 238..248
                  src/extensions/default/UrlCodeHints/unittests.js on lines 262..272

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

                  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

                      function getTextNodeID(textNode) {
                          var childIndex = textNode.parent.children.indexOf(textNode);
                          if (childIndex === 0) {
                              return textNode.parent.tagID + ".0";
                          }
                  Severity: Major
                  Found in src/language/HTMLSimpleDOM.js and 1 other location - About 2 hrs to fix
                  src/LiveDevelopment/MultiBrowserImpl/language/HTMLSimpleDOM.js on lines 198..204

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

                  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