Hirse/brackets-outline-list

View on GitHub

Showing 905 of 905 total issues

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

function isASCIIAlpha(c) {
    return ((c >= CharCodes.LowerA && c <= CharCodes.LowerZ) ||
        (c >= CharCodes.UpperA && c <= CharCodes.UpperZ));
}
Severity: Major
Found in thirdparty/htmlparser2.js and 1 other location - About 1 hr to fix
thirdparty/htmlparser2.js on lines 2174..2177

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

      if (ch === 92) { // '\'
        out += this.input.slice(chunkStart, this.pos);
        out += this.readEscapedChar(true);
        chunkStart = this.pos;
      } else if (isNewLine(ch)) {
Severity: Major
Found in thirdparty/espree.js and 1 other location - About 1 hr to fix
thirdparty/espree.js on lines 6444..6458

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

Function error has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

parser.prototype.error = function(expect) {
  var msg = 'Parse Error : syntax error';
  token = this.getTokenName(this.token);
  if (this.token !== this.EOF) {
    if (isNumber(this.token)) {
Severity: Minor
Found in thirdparty/php-parser.js - About 1 hr to fix

    Function read_trait has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      ,read_trait: function(flag) {
        var result = this.node('trait'),
          propName = null,
          propExtends = null,
          propImplements = null,
    Severity: Minor
    Found in thirdparty/php-parser.js - About 1 hr to fix

      Function < has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          '<': function() {
            var nchar = this._input[this.offset];
            if (nchar === '<') {
              nchar = this._input[this.offset + 1];
              if (nchar === '=') {
      Severity: Minor
      Found in thirdparty/php-parser.js - About 1 hr to fix

        Function read has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.read = function (buffer, offset, isLE, mLen, nBytes) {
          var e, m
          var eLen = (nBytes * 8) - mLen - 1
          var eMax = (1 << eLen) - 1
          var eBias = eMax >> 1
        Severity: Minor
        Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

          Function normalize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            normalize(plugins) {
              let normalized = []
              for (let i of plugins) {
                if (i.postcss === true) {
                  i = i()
          Severity: Minor
          Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

            Function getProxyProcessor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              getProxyProcessor() {
                return {
                  get(node, prop) {
                    if (prop === 'proxyOf') {
                      return node
            Severity: Minor
            Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

              Function constructor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                constructor(processor, css, opts) {
                  css = css.toString()
                  this.stringified = false
              
                  this._processor = processor
              Severity: Minor
              Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

                Function parseFunction has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {
                    this.initFunction(node);
                    if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
                      if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))
                        { this.unexpected(); }
                Severity: Minor
                Found in thirdparty/espree.js - About 1 hr to fix

                  Function regexp_classSetExpression has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    pp$1.regexp_classSetExpression = function(state) {
                      var result = CharSetOk, subResult;
                      if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) {
                        if (subResult === CharSetString) { result = CharSetString; }
                        // https://tc39.es/ecma262/#prod-ClassIntersection
                  Severity: Minor
                  Found in thirdparty/espree.js - About 1 hr to fix

                    Function _createListEntry has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        function _createListEntry(name, args, vis, level, isClass, isStatic, line, ch) {
                    Severity: Major
                    Found in src/languages/PHP.js - About 1 hr to fix

                      Function _createListEntry has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          function _createListEntry(name, type, isPrivate, isStatic, isRegion, args, line, ch) {
                      Severity: Major
                      Found in src/languages/Haxe.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                if (
                                  escape &&
                                  code !== SLASH &&
                                  code !== SPACE &&
                                  code !== NEWLINE &&
                        Severity: Major
                        Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                  if (!this.htmlMode || this.options.recognizeCDATA) {
                                      (_b = (_a = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a);
                                      (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
                                      (_f = (_e = this.cbs).oncdataend) === null || _f === void 0 ? void 0 : _f.call(_e);
                                  }
                          Severity: Major
                          Found in thirdparty/htmlparser2.js - About 1 hr to fix

                            Function parsePropertyValue has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                              pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
                            Severity: Major
                            Found in thirdparty/espree.js - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                    if ((match[1] || match[2]) === "use strict") {
                                      skipWhiteSpace.lastIndex = start + match[0].length;
                                      var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
                                      var next = this.input.charAt(end);
                                      return next === ";" || next === "}" ||
                              Severity: Major
                              Found in thirdparty/espree.js - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                    if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
                                      var isConstructor = !node.static && checkKeyName(node, "constructor");
                                      var allowsDirectSuper = isConstructor && constructorAllowsSuper;
                                      // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.
                                      if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); }
                                Severity: Major
                                Found in thirdparty/espree.js - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
                                          (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
                                        return i + 1
                                      }
                                  Severity: Major
                                  Found in thirdparty/espree.js - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                        if (isExpression) {
                                          node.body = this.parseMaybeAssign(forInit);
                                          node.expression = true;
                                          this.checkParams(node, false);
                                        } else {
                                    Severity: Major
                                    Found in thirdparty/espree.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language