Showing 7 of 167 total issues
Function render
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const props: Object = this.props
const size: number = props.size
const state = this.state
Function Button
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function Button (props: Props): React.createElement {
let sizeId: string
if (props.sizes) sizeId = props.sizes
else { sizeId = 'default' }
let padding = '5px 4px'
Function ProgressBar
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ProgressBar (props: Props) {
// If progressCount is not a number then..
if (!props.progressCount || typeof props.progressCount !== 'number') {
throw new ReactInvalidPropException({
prop: 'progressCount',
Function FormBasic
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function FormBasic (props: {}): React.createElement {
const styles: Object = StyleSheet.create({
inputStyle: {
border: '1px solid rgb(128, 128, 128)',
borderRadius: '3.5px',
Function render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
render () {
const props: Object = this.props
const size: number = props.size
const state = this.state
- 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 ProgressBar
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function ProgressBar (props: Props) {
// If progressCount is not a number then..
if (!props.progressCount || typeof props.progressCount !== 'number') {
throw new ReactInvalidPropException({
prop: 'progressCount',
- 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 Button
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function Button (props: Props): React.createElement {
let sizeId: string
if (props.sizes) sizeId = props.sizes
else { sizeId = 'default' }
let padding = '5px 4px'
- 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"