boldr/boldr-ui

View on GitHub
internal/scripts/generate-docs-markdown.js

Summary

Maintainability
B
6 hrs
Test Coverage

Function generatePropDescription has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function generatePropDescription(required, description, type) {
  let deprecated = '';

  if (type.name === 'custom') {
    const deprecatedInfo = getDeprecatedInfo(type);
Severity: Minor
Found in internal/scripts/generate-docs-markdown.js - About 1 hr to fix

    Function generatePropType has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function generatePropType(type) {
      switch (type.name) {
        case 'func':
          return 'function';
    
    
    Severity: Minor
    Found in internal/scripts/generate-docs-markdown.js - About 1 hr to fix

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

      function generatePropDescription(required, description, type) {
        let deprecated = '';
      
        if (type.name === 'custom') {
          const deprecatedInfo = getDeprecatedInfo(type);
      Severity: Minor
      Found in internal/scripts/generate-docs-markdown.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 generateProps has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function generateProps(props) {
        const header = '## Props';
      
        let text = `${header}
      | Name | Type | Default | Description |
      Severity: Minor
      Found in internal/scripts/generate-docs-markdown.js - About 1 hr to fix

        Function generatePropType has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        function generatePropType(type) {
          switch (type.name) {
            case 'func':
              return 'function';
        
        
        Severity: Minor
        Found in internal/scripts/generate-docs-markdown.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

        Parsing error: The keyword 'import' is reserved
        Open

        import { parse as parseDoctrine } from 'doctrine';

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

        There are no issues that match your filters.

        Category
        Status