internal/scripts/generate-docs-markdown.js
Function generatePropDescription
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generatePropDescription(required, description, type) {
let deprecated = '';
if (type.name === 'custom') {
const deprecatedInfo = getDeprecatedInfo(type);
Function generatePropType
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function generatePropType(type) {
switch (type.name) {
case 'func':
return 'function';
Function generatePropDescription
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
function generatePropDescription(required, description, type) {
let deprecated = '';
if (type.name === 'custom') {
const deprecatedInfo = getDeprecatedInfo(type);
- Read upRead up
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
Open
function generateProps(props) {
const header = '## Props';
let text = `${header}
| Name | Type | Default | Description |
Function generatePropType
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
function generatePropType(type) {
switch (type.name) {
case 'func':
return 'function';
- Read upRead up
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
Open
import { parse as parseDoctrine } from 'doctrine';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/