RubyLouvre/anu

View on GitHub

Showing 880 of 880 total issues

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

export default {
    input: './packages/render/miniapp/index.quick.js',
    output: [{
        strict: false,
        format: 'es',
Severity: Major
Found in scripts/build/rollup.quick.js and 2 other locations - About 1 day to fix
scripts/build/rollup.ali.js on lines 10..70
scripts/build/rollup.bu.js on lines 10..70

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

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

export default {
    input: './packages/render/miniapp/index.bu.js',
    output: [{
        strict: false,
        format: 'es',
Severity: Major
Found in scripts/build/rollup.bu.js and 2 other locations - About 1 day to fix
scripts/build/rollup.ali.js on lines 10..70
scripts/build/rollup.quick.js on lines 10..70

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

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

export default {
    input: './packages/render/miniapp/index.ali.js',
    output: [{
        strict: false,
        format: 'es',
Severity: Major
Found in scripts/build/rollup.ali.js and 2 other locations - About 1 day to fix
scripts/build/rollup.bu.js on lines 10..70
scripts/build/rollup.quick.js on lines 10..70

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

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

File ReactES6Class-test.js has 514 lines of code (exceeds 250 allowed). Consider refactoring.
Open

let PropTypes;
let React;
let ReactDOM;

describe('ReactES6Class', () => {
Severity: Major
Found in packages/core/__tests__/ReactES6Class-test.js - About 1 day to fix

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

            function assertCalls() {
                expect(callback.calls.count()).toBe(9);
                expect(callback).toHaveBeenCalledWith(div, 0);
                expect(callback).toHaveBeenCalledWith(span, 1);
                expect(callback).toHaveBeenCalledWith(a, 2);
    Severity: Major
    Found in packages/core/__tests__/ReactChildren-test.js and 1 other location - About 7 hrs to fix
    packages/core/__tests__/ReactChildren-test.js on lines 502..514

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

    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

            function assertCalls() {
                expect(callback.calls.count()).toBe(9);
                expect(callback).toHaveBeenCalledWith(div, 0);
                expect(callback).toHaveBeenCalledWith(span, 1);
                expect(callback).toHaveBeenCalledWith(a, 2);
    Severity: Major
    Found in packages/core/__tests__/ReactChildren-test.js and 1 other location - About 7 hrs to fix
    packages/core/__tests__/ReactChildren-test.js on lines 144..156

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

    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

    File index.jsx has 486 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable jsx-a11y/anchor-has-content */
    import { miniCreateClass, getWindow } from "react-core/util";
    
    import {
        startsWith,
    Severity: Minor
    Found in packages/router/index.jsx - About 7 hrs to fix

      File ReactProxy.js has 483 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * by 司徒正美 Copyright 2018-05-15
       * IE9+
       */
      
      
      Severity: Minor
      Found in lib/ReactProxy.js - About 7 hrs to fix

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

                class Test extends React.Component {
                    state = { step: 1, extra: true };
                    UNSAFE_componentWillReceiveProps() {
                        this.setState({ step: 2 }, () => {
                            // Tests that earlier setState callbacks are not dropped
        packages/render/dom/__tests__/ReactCompositeComponentState-test.js on lines 401..415

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

        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

                class Test extends React.Component {
                    state = { step: 1, extra: true };
                    UNSAFE_componentWillMount() {
                        this.setState({ step: 2 }, () => {
                            // Tests that earlier setState callbacks are not dropped
        packages/render/dom/__tests__/ReactCompositeComponentState-test.js on lines 363..377

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

        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

        File Renderer.js has 464 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Copyright (c) 2013-present, Facebook, Inc.
         *
         * This source code is licensed under the MIT license found in the
         * LICENSE file in the root directory of this source tree.
        Severity: Minor
        Found in packages/render/server/Renderer.js - About 7 hrs to fix

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

              var Constructor = miniCreateClass(function Ctor() {
                  if (!(this instanceof Component)) {
                      throw "must new Component(...)";
                  }
                  for (var methodName in this) {
          Severity: Major
          Found in lib/createClass.js and 1 other location - About 7 hrs to fix
          packages/core/createClass.js on lines 102..119

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

          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

              let Constructor = miniCreateClass(function Ctor() {
                  if (!(this instanceof Component)) {
                      throw "must new Component(...)";
                  }
                  for (let methodName in this) {
          Severity: Major
          Found in packages/core/createClass.js and 1 other location - About 7 hrs to fix
          lib/createClass.js on lines 141..157

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

          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

          File ReactMount-test.js has 461 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          
          'use strict';
          
          
          let React;
          Severity: Minor
          Found in packages/render/dom/__tests__/ReactMount-test.js - About 7 hrs to fix

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

              it('does change the string ".98" to "0.98" with no change handler', () => {
                class Stub extends React.Component {
                  state = {
                    value: '.98',
                  };
            Severity: Major
            Found in packages/render/dom/__tests__/ReactDOMInput-test.js and 1 other location - About 6 hrs to fix
            packages/render/dom/__tests__/ReactDOMInput-test.js on lines 287..309

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

            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('distinguishes precision for extra zeroes in string number values', () => {
                class Stub extends React.Component {
                  state = {
                    value: '3.0000',
                  };
            Severity: Major
            Found in packages/render/dom/__tests__/ReactDOMInput-test.js and 1 other location - About 6 hrs to fix
            packages/render/dom/__tests__/ReactDOMInput-test.js on lines 219..240

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

            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 findCatchComponent has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
            Open

            function findCatchComponent(fiber, names, hook) {
                let instance,
                    name,
                    topFiber = fiber,
                    retry,
            Severity: Minor
            Found in packages/fiber/ErrorBoundary.js - About 6 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function reconcileDFS has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
            Open

            export function reconcileDFS(fiber, info, deadline, ENOUGH_TIME) {
                var topWork = fiber;
                outerLoop: while (fiber) {
                    if (fiber.disposed || deadline.timeRemaining() <= ENOUGH_TIME) {
                        break;
            Severity: Minor
            Found in packages/fiber/beginWork.js - About 6 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

              it('should cycle order correctly', () => {
                const PROPS_SEQUENCE = [
                  {
                    usernameToStatus: {
                      userOne: 'userOneStatus',
            packages/render/dom/__tests__/ReactMultiChildReconcile-test.js on lines 563..608

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

            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 cycle order correctly in the other direction', () => {
                const PROPS_SEQUENCE = [
                  {
                    usernameToStatus: {
                      userOne: 'userOneStatus',
            packages/render/dom/__tests__/ReactMultiChildReconcile-test.js on lines 516..561

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

            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