Showing 341 of 341 total issues

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

const esmConfig = Object.assign({}, baseConfig, {
  output: Object.assign({}, baseConfig.output, {
    sourcemap: true,
    format: 'es',
    file: join(cwd, 'dist/index.esm.js')
Severity: Major
Found in packages/nerv/rollup.config.js and 1 other location - About 1 hr to fix
packages/nerv-create-class/rollup.config.js on lines 78..84

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

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

        nextElementSibling: {
          get: function () {
            var nextElementSibling = this.nextSibling;
            while (nextElementSibling && nextElementSibling.nodeType != 1) {
              nextElementSibling = nextElementSibling.nextSibling;
Severity: Major
Found in browsers/polyfill.js and 1 other location - About 1 hr to fix
browsers/polyfill.js on lines 334..342

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

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 esmConfig = Object.assign({}, baseConfig, {
  output: Object.assign({}, baseConfig.output, {
    sourcemap: true,
    format: 'es',
    file: join(cwd, 'dist/index.esm.js')
Severity: Major
Found in packages/nerv-create-class/rollup.config.js and 1 other location - About 1 hr to fix
packages/nerv/rollup.config.js on lines 79..85

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

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

async function f () {
  const response = await prompts({
    type: 'select',
    name: 'version',
    message: `What's the release version?`,
Severity: Minor
Found in release.js - About 1 hr to fix

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

        const verifyLifycycleMethods = TestComponent => {
          const proto = TestComponent.prototype
          const protoSpy = {}
          spies.forEach(s => {
            protoSpy[s] = sinon.spy(proto, s)
    Severity: Minor
    Found in packages/nerv/__tests__/lifecycle.spec.js - About 1 hr to fix

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

            componentDidMount () {
              this.setState(
                {
                  a: true
                },
      Severity: Minor
      Found in packages/nerv/__tests__/component.spec.js - About 1 hr to fix

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

        export function mountVNode (vnode: VNode, isSvg?: boolean, parentContext?, parentComponent?) {
          if (vnode.isSvg) {
            isSvg = true
          } else if (vnode.type === 'svg') {
            isSvg = true
        Severity: Minor
        Found in packages/nerv/src/vdom/create-element.ts - About 1 hr to fix

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

          export function unmount (vnode, parentDom?) {
            if (isInvalid(vnode)) {
              return
            }
            const vtype = vnode.vtype
          Severity: Minor
          Found in packages/nerv/src/vdom/unmount.ts - About 1 hr to fix

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

                  render () {
                    inst = this
                    const { step } = this.state
                    if (step === 0) {
                      return null
            Severity: Minor
            Found in packages/nerv/__tests__/svg.spec.js - About 1 hr to fix

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

                update (vnode) {
                  const data = getData(vnode)
              
                  // Children must be updated first
                  if (Array.isArray(data.children)) {
              Severity: Minor
              Found in packages/nerv-devtools/src/renderer.ts - About 1 hr to fix

                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

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

                  it('should alias className to class', () => {
                    render(<div className='bar' />, scratch)
                    expect(scratch.childNodes[0].className).toBe('bar')
                  })
                Severity: Major
                Found in packages/nerv/__tests__/render.spec.js and 1 other location - About 1 hr to fix
                packages/nerv/__tests__/render.spec.js on lines 213..216

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

                        pageY: {get: function(){ return this._pageY || (this._pageY = this.clientY + window.scrollY - (html.clientTop || 0)); }},
                Severity: Major
                Found in browsers/polyfill.js and 1 other location - About 1 hr to fix
                browsers/polyfill.js on lines 587..587

                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(
                      arr5.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 95..97
                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 2 locations. Consider refactoring.
                Open

                      function Comp () {
                        const [counter, setCounter] = useState(0)
                
                        useEffect(() => {
                          if (counter === 0) setCounter(1)
                Severity: Major
                Found in packages/nerv/__tests__/hooks.spec.js and 1 other location - About 1 hr to fix
                packages/nerv/__tests__/hooks.spec.js on lines 579..588

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

                      function Comp () {
                        const [counter, setCounter] = useState(0)
                
                        useLayoutEffect(() => {
                          if (counter === 0) setCounter(1)
                Severity: Major
                Found in packages/nerv/__tests__/hooks.spec.js and 1 other location - About 1 hr to fix
                packages/nerv/__tests__/hooks.spec.js on lines 683..692

                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 164..168

                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(
                      arr4.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 90..92
                packages/nerv/__tests__/keys.spec.js on lines 95..97
                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(
                      arr7.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 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

                Severity
                Category
                Status
                Source
                Language