Showing 341 of 341 total issues

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

    render(
      <div>
        <Provider value={CONTEXT}>
          <NoUpdate>
            <Consumer>{data => <Inner {...data} />}</Consumer>
Severity: Major
Found in packages/nerv/__tests__/createContext.spec.js and 1 other location - About 2 hrs to fix
packages/nerv/__tests__/createContext.spec.js on lines 205..214

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

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

          return (
            <div>
              <X>
                <span>1</span>
              </X>
Severity: Major
Found in packages/nerv/__tests__/fragments.spec.js and 1 other location - About 2 hrs to fix
packages/nerv/__tests__/fragments.spec.js on lines 188..198

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

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

        return (
          <div>
            <X>
              <div>1</div>
            </X>
Severity: Major
Found in packages/nerv/__tests__/fragments.spec.js and 1 other location - About 2 hrs to fix
packages/nerv/__tests__/fragments.spec.js on lines 175..185

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

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

    class Inner extends Component {
      constructor () {
        super(...arguments)
        inst = this
      }
Severity: Major
Found in packages/nerv/__tests__/createContext.spec.js and 2 other locations - About 2 hrs to fix
packages/nerv/__tests__/createContext.spec.js on lines 372..384
packages/nerv/__tests__/createContext.spec.js on lines 385..397

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

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

    class Inner extends Component {
      constructor () {
        super(...arguments)
        innerInst = this
      }
Severity: Major
Found in packages/nerv/__tests__/createContext.spec.js and 2 other locations - About 2 hrs to fix
packages/nerv/__tests__/createContext.spec.js on lines 111..123
packages/nerv/__tests__/createContext.spec.js on lines 385..397

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

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

    class Nested extends Component {
      constructor () {
        super(...arguments)
        nestedInst = this
      }
Severity: Major
Found in packages/nerv/__tests__/createContext.spec.js and 2 other locations - About 2 hrs to fix
packages/nerv/__tests__/createContext.spec.js on lines 111..123
packages/nerv/__tests__/createContext.spec.js on lines 372..384

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

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

        addEventListener: valueDesc(function (type, handler, capture) {
          if (typeof handler !== 'function' && typeof handler !== 'object') return;
          var
            self = this,
            ontype = 'on' + type,
Severity: Major
Found in browsers/polyfill.js - About 2 hrs to fix

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

      for (var i = 0; i < items.length; i++) {
        var item = items[i]
        children.push(
          Nerv.createElement(AnimBox, {
            key: item.id,
    Severity: Major
    Found in benchmarks/uibench/app.js and 1 other location - About 2 hrs to fix
    benchmarks/uibench/app.js on lines 67..76

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

    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 uglifyPlugin = uglify({
      compress: {
        // compress options
        booleans: true,
        dead_code: true,
    Severity: Major
    Found in packages/nerv-create-class/rollup.config.js and 1 other location - About 2 hrs to fix
    packages/nerv/rollup.config.js on lines 30..47

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

    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

      for (var i = 0; i < items.length; i++) {
        var item = items[i]
        children.push(
          Nerv.createElement(TableRow, {
            key: item.id,
    Severity: Major
    Found in benchmarks/uibench/app.js and 1 other location - About 2 hrs to fix
    benchmarks/uibench/app.js on lines 107..116

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

    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 uglifyPlugin = uglify({
      compress: {
        // compress options
        booleans: true,
        dead_code: true,
    Severity: Major
    Found in packages/nerv/rollup.config.js and 1 other location - About 2 hrs to fix
    packages/nerv-create-class/rollup.config.js on lines 29..46

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

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

    function patchStyle (lastAttrValue: CSSStyleSheet, nextAttrValue: CSSStyleSheet, dom: HTMLElement) {
      const domStyle = dom.style
      let style
      let value
    
    
    Severity: Minor
    Found in packages/nerv/src/vdom/patch.ts - About 2 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 cloneElement has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function cloneElement (vnode, props?: object, ...children): any {
      if (isVText(vnode)) {
        return createVText(vnode.text)
      }
      if (isString(vnode) || isNumber(vnode)) {
    Severity: Major
    Found in packages/nerv/src/clone-element.ts - About 2 hrs to fix

      Function getComputedStyle has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              getComputedStyle: valueDesc(function(){
        
                var // partially grabbed from jQuery and Dean's hack
                  notpixel = /^(?:[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|))(?!px)[a-z%]+$/,
                  position = /^(top|right|bottom|left)$/,
      Severity: Major
      Found in browsers/polyfill.js - About 2 hrs to fix

        Function getData has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function getData (_vnode) {
          const vnode = _vnode instanceof Component ? _vnode.vnode : _vnode
          const component = vnode.component
          let updater: any = null
        
        
        Severity: Minor
        Found in packages/nerv-devtools/src/utils.ts - About 2 hrs to fix

          Function attachEvent has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
          Open

          export function attachEvent (
            domNode: Element,
            eventName: string,
            handler: Function
          ) {
          Severity: Minor
          Found in packages/nerv/src/event.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 getData has 47 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function getData(keepIdentity) {
                var oldData = data
                if (!keepIdentity) {
                  // reset for each tick when !keepIdentity
                  data = []
          Severity: Minor
          Found in benchmarks/DBMonster/ENV.js - About 1 hr to fix

            Function RenderRate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var RenderRate = function() {
                  var container = document.createElement('div')
                  container.id = 'stats'
                  container.style.cssText =
                    'width:150px;opacity:0.9;cursor:pointer;position:fixed;right:80px;bottom:0px;'
            Severity: Minor
            Found in benchmarks/DBMonster/monitor.js - About 1 hr to fix

              Function generateRow has 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function generateRow(object, keepIdentity, counter) {
                    var nbQueries = Math.floor(Math.random() * 10 + 1)
                    if (!object) {
                      object = {}
                    }
              Severity: Minor
              Found in benchmarks/DBMonster/ENV.js - About 1 hr to fix

                Function patchNonKeyedChildren has a Cognitive Complexity of 14 (exceeds 5 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

                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

                Severity
                Category
                Status
                Source
                Language