Showing 341 of 341 total issues

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

    expect(container.textContent.split(',')).toEqual(
      arr6.map(({ n }) => String(n)).concat([''])
    )
Severity: Major
Found in packages/nerv/__tests__/keys.spec.js and 4 other locations - About 1 hr to fix
packages/nerv/__tests__/keys.spec.js on lines 81..83
packages/nerv/__tests__/keys.spec.js on lines 90..92
packages/nerv/__tests__/keys.spec.js on lines 100..102
packages/nerv/__tests__/keys.spec.js on lines 105..107

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

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

    expect(container.textContent.split(',')).toEqual(
      arr8.map(({ n }) => String(n)).concat([''])
    )
Severity: Major
Found in packages/nerv/__tests__/keys.spec.js and 4 other locations - About 1 hr to fix
packages/nerv/__tests__/keys.spec.js on lines 81..83
packages/nerv/__tests__/keys.spec.js on lines 90..92
packages/nerv/__tests__/keys.spec.js on lines 95..97
packages/nerv/__tests__/keys.spec.js on lines 100..102

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

      class Comp extends Component {
        render () {
          return <div>{this.context.foo + '-' + this.context.getFoo()}</div>
        }
      }
Severity: Major
Found in packages/nerv/__tests__/dom.spec.js and 1 other location - About 1 hr to fix
packages/nerv/__tests__/dom.spec.js on lines 121..125

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

Function getPropertyValue has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

          ComputedStyle.prototype.getPropertyValue = function (name) {
            var
              el = this._,
              style = el.style,
              currentStyle = el.currentStyle,
Severity: Minor
Found in browsers/polyfill.js - About 1 hr to fix

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

          class App extends Component {
            constructor () {
              super()
              update = () => this.setState({})
            }
    Severity: Major
    Found in packages/nerv/__tests__/component.spec.js and 1 other location - About 1 hr to fix
    packages/nerv/__tests__/component.spec.js on lines 771..779

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

    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

      swapRows() {
        startMeasure("swapRows");
        this.state.store.swapRows();
        this.setState({ store: this.state.store });
      }
    Severity: Major
    Found in benchmarks/js-framwork-bench/src/Main.jsx and 5 other locations - About 1 hr to fix
    benchmarks/js-framwork-bench/src/Main.jsx on lines 108..112
    benchmarks/js-framwork-bench/src/Main.jsx on lines 113..117
    benchmarks/js-framwork-bench/src/Main.jsx on lines 118..122
    benchmarks/js-framwork-bench/src/Main.jsx on lines 133..137
    benchmarks/js-framwork-bench/src/Main.jsx on lines 138..142

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

    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

      clear() {
        startMeasure("clear");
        this.state.store.clear();
        this.setState({ store: this.state.store });
      }
    Severity: Major
    Found in benchmarks/js-framwork-bench/src/Main.jsx and 5 other locations - About 1 hr to fix
    benchmarks/js-framwork-bench/src/Main.jsx on lines 108..112
    benchmarks/js-framwork-bench/src/Main.jsx on lines 113..117
    benchmarks/js-framwork-bench/src/Main.jsx on lines 118..122
    benchmarks/js-framwork-bench/src/Main.jsx on lines 133..137
    benchmarks/js-framwork-bench/src/Main.jsx on lines 143..147

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

    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

      run() {
        startMeasure("run");
        this.state.store.run();
        this.setState({ store: this.state.store });
      }
    Severity: Major
    Found in benchmarks/js-framwork-bench/src/Main.jsx and 5 other locations - About 1 hr to fix
    benchmarks/js-framwork-bench/src/Main.jsx on lines 113..117
    benchmarks/js-framwork-bench/src/Main.jsx on lines 118..122
    benchmarks/js-framwork-bench/src/Main.jsx on lines 133..137
    benchmarks/js-framwork-bench/src/Main.jsx on lines 138..142
    benchmarks/js-framwork-bench/src/Main.jsx on lines 143..147

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

    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

      update() {
        startMeasure("update");
        this.state.store.update();
        this.setState({ store: this.state.store });
      }
    Severity: Major
    Found in benchmarks/js-framwork-bench/src/Main.jsx and 5 other locations - About 1 hr to fix
    benchmarks/js-framwork-bench/src/Main.jsx on lines 108..112
    benchmarks/js-framwork-bench/src/Main.jsx on lines 113..117
    benchmarks/js-framwork-bench/src/Main.jsx on lines 133..137
    benchmarks/js-framwork-bench/src/Main.jsx on lines 138..142
    benchmarks/js-framwork-bench/src/Main.jsx on lines 143..147

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

    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

      runLots() {
        startMeasure("runLots");
        this.state.store.runLots();
        this.setState({ store: this.state.store });
      }
    Severity: Major
    Found in benchmarks/js-framwork-bench/src/Main.jsx and 5 other locations - About 1 hr to fix
    benchmarks/js-framwork-bench/src/Main.jsx on lines 108..112
    benchmarks/js-framwork-bench/src/Main.jsx on lines 113..117
    benchmarks/js-framwork-bench/src/Main.jsx on lines 118..122
    benchmarks/js-framwork-bench/src/Main.jsx on lines 138..142
    benchmarks/js-framwork-bench/src/Main.jsx on lines 143..147

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

    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

          class App extends Component {
            constructor () {
              super()
              update = () => this.setState({})
            }
    Severity: Major
    Found in packages/nerv/__tests__/component.spec.js and 1 other location - About 1 hr to fix
    packages/nerv/__tests__/component.spec.js on lines 743..751

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

    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 InnerMost extends Component {
          render () {
            return (
              <div>
                <Consumer>{data => <Consumed {...data} />}</Consumer>
    Severity: Major
    Found in packages/nerv/__tests__/createContext.spec.js and 1 other location - About 1 hr to fix
    packages/nerv/__tests__/createContext.spec.js on lines 264..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 58.

    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 InnerMost extends Component {
          render () {
            return (
              <div>
                <Consumer>{data => <Consumed {...data} />}</Consumer>
    Severity: Major
    Found in packages/nerv/__tests__/createContext.spec.js and 1 other location - About 1 hr to fix
    packages/nerv/__tests__/createContext.spec.js on lines 322..330

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

    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

      add() {
        startMeasure("add");
        this.state.store.add();
        this.setState({ store: this.state.store });
      }
    Severity: Major
    Found in benchmarks/js-framwork-bench/src/Main.jsx and 5 other locations - About 1 hr to fix
    benchmarks/js-framwork-bench/src/Main.jsx on lines 108..112
    benchmarks/js-framwork-bench/src/Main.jsx on lines 118..122
    benchmarks/js-framwork-bench/src/Main.jsx on lines 133..137
    benchmarks/js-framwork-bench/src/Main.jsx on lines 138..142
    benchmarks/js-framwork-bench/src/Main.jsx on lines 143..147

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

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

    function patchNonKeyedChildren (
      parentDom: Element,
      lastChildren,
      nextChildren,
      context: object,
    Severity: Minor
    Found in packages/nerv/src/vdom/patch.ts - About 1 hr to fix

      Function createElement has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function createElement (
        vnode: VirtualNode | VirtualNode[],
        isSvg?: boolean,
        parentContext?,
        parentComponent?
      Severity: Minor
      Found in packages/nerv/src/vdom/create-element.ts - About 1 hr to fix

        Function applyMixins has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function applyMixins (Cl: any, mixins: Function[] | any[]) {
          for (const key in mixins) {
            if (mixins.hasOwnProperty(key)) {
              const mixin = mixins[key]
        
        
        Severity: Minor
        Found in packages/nerv-create-class/src/index.ts - About 1 hr 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 patchProps has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function patchProps (
          domNode: Element,
          nextProps: Props,
          previousProps: Props,
          lastVnode: VNode,
        Severity: Minor
        Found in packages/nerv/src/vdom/patch.ts - About 1 hr 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 attachEventToDocument has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function attachEventToDocument (d, eventName, delegatedRoots) {
          const eventHandler = (event) => {
            const items = delegatedRoots.items
            const count = items.size
            if (count > 0) {
        Severity: Minor
        Found in packages/nerv/src/event.ts - About 1 hr to fix

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

                          <div className="col-sm-6 smallpad">
                            <button
                              type="button"
                              className="btn btn-primary btn-block"
                              id="add"
          Severity: Major
          Found in benchmarks/js-framwork-bench/src/Main.jsx and 5 other locations - About 1 hr to fix
          benchmarks/js-framwork-bench/src/Main.jsx on lines 158..167
          benchmarks/js-framwork-bench/src/Main.jsx on lines 168..177
          benchmarks/js-framwork-bench/src/Main.jsx on lines 188..197
          benchmarks/js-framwork-bench/src/Main.jsx on lines 198..207
          benchmarks/js-framwork-bench/src/Main.jsx on lines 208..217

          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

          Severity
          Category
          Status
          Source
          Language