Intellicode/eslint-plugin-react-native

View on GitHub

Showing 26 of 55 total issues

Function elementName has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

const elementName = (node) => {
  const reversedIdentifiers = [];
  if (
    node.type === 'JSXElement'
    && node.openingElement.type === 'JSXOpeningElement'
Severity: Minor
Found in lib/rules/no-raw-text.js - About 55 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 create has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  create(context) {
    function reportNode(JSXExpressionNode) {
      context.report({
        node: JSXExpressionNode,
        message:
Severity: Minor
Found in lib/rules/no-single-element-style-arrays.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 report has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function report(array, type, node, prev, current) {
Severity: Minor
Found in lib/rules/sort-styles.js - About 35 mins to fix

    Avoid too many return statements within this function.
    Open

          return components.get(currentNode);
    Severity: Major
    Found in lib/util/Components.js - About 30 mins to fix

      Function hasAllowedParent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      const hasAllowedParent = (parent, allowedElements) => {
        let curNode = parent;
      
        while (curNode) {
          if (curNode.type === 'JSXElement') {
      Severity: Minor
      Found in lib/rules/no-raw-text.js - About 25 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 create has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      const create = Components.detect((context, components) => {
        const styleSheets = new StyleSheets();
        const styleReferences = new Set();
      
        function reportUnusedStyles(unusedStyles) {
      Severity: Minor
      Found in lib/rules/no-unused-styles.js - About 25 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

      Severity
      Category
      Status
      Source
      Language