pepjo/react-tabs-navigation

View on GitHub

Showing 6 of 16,214 total issues

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

      render: function () {
        return (
          <div role="application">
            <div>
              {renderFunction(this.props.banner &&
    Severity: Minor
    Found in src/index.js - About 1 hr 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 handleKeyPress has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          handleKeyPress: function (event) {
            if (this.state.focused) {
              if (event.which === KEYS.space || event.which === KEYS.enter) {
                this.handleEnterPress()
              } else if (event.which === KEYS.right) {
        Severity: Minor
        Found in src/tabsKeyboardNavigationMixin.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 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

        Severity
        Category
        Status
        Source
        Language