RubyLouvre/anu

View on GitHub
packages/core/createElement.js

Summary

Maintainability
D
1 day
Test Coverage

Function traverseAllChildren has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function traverseAllChildren(
    children,
    nameSoFar,
    callback,
    bookKeeping
Severity: Major
Found in packages/core/createElement.js - About 2 hrs to fix

    File createElement.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
        typeNumber,
        toWarnDev,
        hasSymbol,
        REACT_ELEMENT_TYPE,
    Severity: Minor
    Found in packages/core/createElement.js - About 2 hrs to fix

      Function makeProps has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      function makeProps(type, config, props, children, len) {
          // Remaining properties override existing props
          let defaultProps, propName;
          for (propName in config) {
              if (
      Severity: Minor
      Found in packages/core/createElement.js - 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 traverseAllChildren has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      export function traverseAllChildren(
          children,
          nameSoFar,
          callback,
          bookKeeping
      Severity: Minor
      Found in packages/core/createElement.js - 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 createElement has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      export function createElement(type, config, ...children) {
          let props = {},
              tag = 5,
              key = null,
              ref = null,
      Severity: Minor
      Found in packages/core/createElement.js - 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 ReactElement has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function ReactElement(type, tag, props, key, ref, owner) {
          var ret = {
              type,
              tag,
              props
      Severity: Minor
      Found in packages/core/createElement.js - About 1 hr to fix

        Function flattenCb has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function flattenCb(context, child, key, childType) {
            if (child === null) {
                lastText = null;
                return;
            }
        Severity: Minor
        Found in packages/core/createElement.js - About 45 mins 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 ReactElement has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        function ReactElement(type, tag, props, key, ref, owner) {
        Severity: Minor
        Found in packages/core/createElement.js - About 45 mins to fix

          Function makeProps has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          function makeProps(type, config, props, children, len) {
          Severity: Minor
          Found in packages/core/createElement.js - About 35 mins to fix

            Function ReactElement has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

            function ReactElement(type, tag, props, key, ref, owner) {
                var ret = {
                    type,
                    tag,
                    props
            Severity: Minor
            Found in packages/core/createElement.js - About 35 mins 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

            There are no issues that match your filters.

            Category
            Status