Hirse/brackets-outline-list

View on GitHub

Showing 905 of 905 total issues

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

    if (this.token === ':') {
      shortForm = true;
      body = this.read_short_form(this.tok.T_ENDFOREACH);
    } else {
      body = this.read_statement();
Severity: Major
Found in thirdparty/php-parser.js and 2 other locations - About 1 hr to fix
thirdparty/php-parser.js on lines 6499..6504
thirdparty/php-parser.js on lines 6565..6570

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

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

  read_if: function() {
    var result = this.node('if'),
      body = null,
      alternate = null,
      shortForm = false,
Severity: Minor
Found in thirdparty/php-parser.js - About 1 hr to fix

    Function read_inner_statement has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      ,read_inner_statement: function() {
        switch(this.token) {
          case this.tok.T_FUNCTION:
            return this.read_function(false, false);
          // optional flags
    Severity: Minor
    Found in thirdparty/php-parser.js - About 1 hr to fix

      Function origin has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        origin(line, column, endLine, endColumn) {
          if (!this.map) return false
          let consumer = this.map.consumer()
      
          let from = consumer.originalPositionFor({ column, line })
      Severity: Minor
      Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

        Function NodeWithChildren has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var NodeWithChildren = /** @class */ (function (_super) {
            __extends(NodeWithChildren, _super);
            /**
             * @param children Children of the node. Only certain node types can have children.
             */
        Severity: Minor
        Found in thirdparty/htmlparser2.js - About 1 hr to fix

          Function get has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

            Function all has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            Promise.all = function(arr) {
              return new Promise(function(resolve, reject) {
                if (!isArray(arr)) {
                  return reject(new TypeError('Promise.all accepts an array'));
                }
            Severity: Minor
            Found in thirdparty/promise.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if (
                        prev === 'url' &&
                        n !== SINGLE_QUOTE &&
                        n !== DOUBLE_QUOTE &&
                        n !== SPACE &&
              Severity: Critical
              Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                    if (
                      curr === "iget" && next === "iset" ||
                      curr === "iset" && next === "iget" ||
                      curr === "sget" && next === "sset" ||
                      curr === "sset" && next === "sget"
                Severity: Critical
                Found in thirdparty/espree.js - About 1 hr to fix

                  Function read_new_expr has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    ,read_new_expr: function() {
                      var result = this.node('new');
                      if (this.token === this.tok.T_CLASS) {
                        var what = this.node('class');
                        // Annonymous class declaration
                  Severity: Minor
                  Found in thirdparty/php-parser.js - About 1 hr to fix

                    Function read_namespace has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      read_namespace: function() {
                        var result = this.node('namespace');
                        this.expect(this.tok.T_NAMESPACE) && this.next();
                        if (this.token == '{') {
                          this.currentNamespace = [''];
                    Severity: Minor
                    Found in thirdparty/php-parser.js - About 1 hr to fix

                      Function _createListEntry has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function _createListEntry(name, args, vis, level, isClass, isStatic, line, ch) {
                              var $elements = [];
                      
                              var $indentation = $(document.createElement("span"));
                              $indentation.addClass("outline-entry-indent");
                      Severity: Minor
                      Found in src/languages/PHP.js - About 1 hr to fix

                        Function loadMap has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          loadMap(file, prev) {
                            if (prev === false) return false
                        
                            if (prev) {
                              if (typeof prev === 'string') {
                        Severity: Minor
                        Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

                          Function plugin has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          postcss.plugin = function plugin(name, initializer) {
                            let warningPrinted = false
                            function creator(...args) {
                              // eslint-disable-next-line no-console
                              if (console && console.warn && !warningPrinted) {
                          Severity: Minor
                          Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

                            Function parsePropertyValue has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
                                if ((isGenerator || isAsync) && this.type === types$1.colon)
                                  { this.unexpected(); }
                            
                                if (this.eat(types$1.colon)) {
                            Severity: Minor
                            Found in thirdparty/espree.js - About 1 hr to fix

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

                              module.exports = function (config) {
                                  "use strict";
                              
                                  config.set({
                                      basePath: "",
                              Severity: Minor
                              Found in karma.conf.js - About 1 hr to fix

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

                                  ,read_for: function() {
                                    var result = this.node('for'),
                                      init = [],
                                      test = [],
                                      increment = [],
                                Severity: Minor
                                Found in thirdparty/php-parser.js - About 1 hr to fix

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

                                    ,read_member_flags: function(asInterface) {
                                      var result = [-1, -1, -1];
                                      if (this.is('T_MEMBER_FLAGS')) {
                                        var idx = 0, val = 0;
                                        do {
                                  Severity: Minor
                                  Found in thirdparty/php-parser.js - About 1 hr to fix

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

                                    Buffer.prototype.copy = function copy (target, targetStart, start, end) {
                                      if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer')
                                      if (!start) start = 0
                                      if (!end && end !== 0) end = this.length
                                      if (targetStart >= target.length) targetStart = target.length
                                    Severity: Minor
                                    Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix

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

                                        handleError(error, node) {
                                          let plugin = this.result.lastPlugin
                                          try {
                                            if (node) node.addToError(error)
                                            this.error = error
                                      Severity: Minor
                                      Found in thirdparty/postcss-safe-parser.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language