Showing 1,982 of 1,982 total issues

Function readToken_lt_gt has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  readToken_lt_gt(code: number): void {
    // '<>'
    const next = this.input.charCodeAt(this.state.pos + 1);
    let size = 1;

Severity: Minor
Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

    Function frame has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        .map((line, index) => {
          const number = start + 1 + index;
          const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
          const gutter = ` ${paddedNumber} | `;
          const hasMarker = markerLines[number];
    Severity: Minor
    Found in packages/babel-code-frame/src/index.js - About 1 hr to fix

      Function isScopable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function isScopable(node: ?Object, opts?: Object): boolean {
        if (!node) return false;
      
        const nodeType = node.type;
        if (
      Severity: Minor
      Found in packages/babel-types/src/validators/generated/index.js - About 1 hr to fix

        Function mark has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          mark(
            generatedLine: number,
            generatedColumn: number,
            line: number,
            column: number,
        Severity: Minor
        Found in packages/babel-generator/src/source-map.js - About 1 hr to fix

          Function normalizeBabelParseConfig has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function normalizeBabelParseConfig(options) {
            const parseOptions = {
              sourceType: options.sourceType,
              filename: options.filePath,
              ...options.babelOptions,
          Severity: Minor
          Found in eslint/babel-eslint-parser/src/configuration.js - About 1 hr to fix

            Function parse has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function parse(input: string, options?: Options): File {
              if (options?.sourceType === "unambiguous") {
                options = {
                  ...options,
                };
            Severity: Minor
            Found in packages/babel-parser/src/index.js - About 1 hr to fix

              Function readToken_numberSign has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                readToken_numberSign(): void {
                  if (this.state.pos === 0 && this.readToken_interpreter()) {
                    return;
                  }
              
              
              Severity: Minor
              Found in packages/babel-parser/src/tokenizer/index.js - About 1 hr to fix

                Function result has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        const result = this.tsTryParseAndCatch(() => {
                          if (!noCalls && this.atPossibleAsyncArrow(base)) {
                            // Almost certainly this is a generic async function `async <T>() => ...
                            // But it might be a call with a type argument `async<T>();`
                            const asyncArrowFn = this.tsTryParseGenericAsyncArrowFunction(
                Severity: Minor
                Found in packages/babel-parser/src/plugins/typescript/index.js - About 1 hr to fix

                  Function parseObjectProperty has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    parseObjectProperty(
                      prop: N.ObjectProperty,
                      startPos: ?number,
                      startLoc: ?Position,
                      isPattern: boolean,
                  Severity: Minor
                  Found in packages/babel-parser/src/parser/expression.js - About 1 hr to fix

                    Function parseAwait has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      parseAwait(): N.AwaitExpression {
                        const node = this.startNode();
                    
                        this.next();
                    
                    
                    Severity: Minor
                    Found in packages/babel-parser/src/parser/expression.js - About 1 hr to fix

                      Function parseExportDefaultExpression has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        parseExportDefaultExpression(): N.Expression | N.Declaration {
                          const expr = this.startNode();
                      
                          const isAsync = this.isAsyncFunction();
                      
                      
                      Severity: Minor
                      Found in packages/babel-parser/src/parser/statement.js - About 1 hr to fix

                        Function buildExportInitializationStatements has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function buildExportInitializationStatements(
                          programPath: NodePath,
                          metadata: ModuleMetadata,
                          loose: boolean = false,
                        ) {
                        Severity: Minor
                        Found in packages/babel-helper-module-transforms/src/index.js - About 1 hr to fix

                          Function extractComputedKeys has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function extractComputedKeys(ref, path, computedPaths, file) {
                            const declarations = [];
                            const state = {
                              classBinding: path.node.id && path.scope.getBinding(path.node.id.name),
                              file,
                          Severity: Minor
                          Found in packages/babel-helper-create-class-features-plugin/src/misc.js - About 1 hr to fix

                            Function Binary has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function Binary(node: Object, parent: Object): boolean {
                              if (
                                node.operator === "**" &&
                                t.isBinaryExpression(parent, { operator: "**" })
                              ) {
                            Severity: Minor
                            Found in packages/babel-generator/src/node/parentheses.js - About 1 hr to fix

                              Function registerBinding has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                registerBinding(kind: string, path: NodePath, bindingPath = path) {
                                  if (!kind) throw new ReferenceError("no `kind`");
                              
                                  if (path.isVariableDeclaration()) {
                                    const declarators: Array<NodePath> = path.get("declarations");
                              Severity: Minor
                              Found in packages/babel-traverse/src/scope/index.js - About 1 hr to fix

                                Function buildRuntimeRewritePlugin has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function buildRuntimeRewritePlugin(runtimeName, relativePath, helperName) {
                                  function adjustImportPath(node, relativePath) {
                                    node.value =
                                      helpers.list.indexOf(node.value) !== -1
                                        ? `./${node.value}`
                                Severity: Minor
                                Found in packages/babel-plugin-transform-runtime/scripts/build-dist.js - About 1 hr to fix

                                  Function ReferencedIdentifier has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    ReferencedIdentifier(path, state) {
                                      // Don't hoist regular JSX identifiers ('div', 'span', etc).
                                      // We do have to consider member expressions for hoisting (e.g. `this.component`)
                                      if (
                                        path.isJSXIdentifier() &&
                                  Severity: Minor
                                  Found in packages/babel-traverse/src/path/lib/hoister.js - About 1 hr to fix

                                    Function compile has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function compile(code, filename) {
                                      // merge in base options and resolve all the plugins and presets relative to this file
                                      const opts = new OptionManager().init(
                                        // sourceRoot can be overwritten
                                        {
                                    Severity: Minor
                                    Found in packages/babel-register/src/node.js - About 1 hr to fix

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

                                          return () => {
                                            return id
                                              .split(".")
                                              .map(name => t.identifier(name))
                                              .reduce((object, property) => t.memberExpression(object, property));
                                      packages/babel-plugin-transform-react-jsx/src/transform-classic.js on lines 24..29

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

                                      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

                                        const createIdentifierParser = (id: string) => () => {
                                          return id
                                            .split(".")
                                            .map(name => t.identifier(name))
                                            .reduce((object, property) => t.memberExpression(object, property));
                                      packages/babel-helper-builder-react-jsx-experimental/src/index.js on lines 400..405

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

                                      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