pepjo/react-tabs-navigation

View on GitHub
src/tabs.js

Summary

Maintainability
B
5 hrs
Test Coverage

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

  render: function () {
    const styles = this.styles() // Gets the user styles for this element
    let filler = this.state.menuFixed
    ? <div
      style={{
Severity: Major
Found in src/tabs.js - About 2 hrs to fix

    Function render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      render: function () {
        const styles = this.styles() // Gets the user styles for this element
        let filler = this.state.menuFixed
        ? <div
          style={{
    Severity: Minor
    Found in src/tabs.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 elements has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        let elements = this.props.elements.map((element, i) => {
          let style = {
            width: elementWidth + '%'
          }
    
    
    Severity: Minor
    Found in src/tabs.js - About 1 hr to fix

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

        styles: function () {
          let styles = {
            lineStyle: this.props.lineStyle || {},
            selectedTabStyle: this.props.selectedTabStyle || defaultStyles.selectedTabStyle,
            tabsStyle: this.props.tabsStyle || {},
      Severity: Minor
      Found in src/tabs.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

      Definition for rule 'react/jsx-sort-prop-types' was not found
      Open

      'use strict'
      Severity: Minor
      Found in src/tabs.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Missing parentheses around multilines JSX
      Open

          ? <div
      Severity: Minor
      Found in src/tabs.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      Props should be sorted alphabetically
      Open

                  aria-multiselectable="false"
      Severity: Minor
      Found in src/tabs.js by eslint

      For more information visit Source: http://eslint.org/docs/rules/

      There are no issues that match your filters.

      Category
      Status