Showing 15 of 455 total issues
File CustomForms.test.js
has 532 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { transition } from '../Mixins/transition'
import { size } from '../Functions/size'
import {
customFormsTransition,
customRangeThumbFocusBoxShadow,
File CustomForms.js
has 447 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { transition } from '../Mixins/transition'
import { size } from '../Functions/size'
import {
customFormsTransition,
customRangeThumbFocusBoxShadow,
File Forms.test.js
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
inputPaddingY, inputPaddingX, inputLineHeight,
inputColor, inputBg, inputBorderWidth, inputBorderColor,
inputBorderRadius, inputBoxShadow, inputTransition,
inputPlaceholderColor, inputDisabledBg,
File buttons.test.js
has 347 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { darken } from '../Functions/darken'
import { rgba } from '../Functions/rgba'
import { colorYiq } from '../Functions/colorYiq'
import { gradientBg } from './gradients'
import { boxShadow } from './boxShadow'
Function formValidationState
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const formValidationState = (state, color) => {
const expectValue = {}
expectValue[`${state}Feedback`] = {
display: 'none',
File Card.test.js
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
cardBg, cardBorderWidth, cardBorderColor,
cardBorderRadius, cardSpacerX, cardSpacerY,
cardCapBg, cardInnerBorderRadius,
cardImgOverlayPadding,
File Carousel.test.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
carouselTransition,
carouselControlWidth,
carouselControlColor,
carouselControlOpacity,
File button.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react'
import { storiesOf } from '@storybook/react'
import { Reboot, Classes } from 'bootstrap-jss'
import { replace } from 'lodash'
import injectSheet, { ThemeProvider } from 'react-jss'
Function cardGroup
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const cardGroup = (isEnableRounded = enableRounded) => {
const isEnableRoundedValue = isEnableRounded => ({
'&:first-child': {
...borderRightRadius(0),
'&$cardImgTop,&$cardHeader': {
File Card.js
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
cardBg, cardBorderWidth, cardBorderColor,
cardBorderRadius, cardSpacerX, cardSpacerY,
cardCapBg, cardInnerBorderRadius,
cardImgOverlayPadding,
Function makeGridColumns
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const makeGridColumns = (columns = gridColumns, gutter = gridGutterWidth, breakpoints = gridBreakpoints) => {
const gutterSize = size(gutter)
const gridColumn = {
Function navbarExpand
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const navbarExpand = () => {
const navbarExpandValue = {}
for (const [breakpoint] of Object.entries(gridBreakpoints)) {
const next = breakpointNext(breakpoint, gridBreakpoints)
const infix = breakpointInfix(next, gridBreakpoints)
Function buttonOutlineVariant
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const buttonOutlineVariant = (color, colorHover, ativeBackgroundColor, activeBorderColor, mybtnFocusWidth, myEnableShadows) => {
colorHover = colorHover || colorYiq(color)
ativeBackgroundColor = ativeBackgroundColor || color
activeBorderColor = activeBorderColor || color
mybtnFocusWidth = mybtnFocusWidth || btnFocusWidth
Function dropdownItem
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const dropdownItem = (isEnableGradients = enableGradients) => {
const backgroundImageValue = isEnableGradients ? {
backgroundImage: 'none'
} : null
Function breakpointNext
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
const breakpointNext = (name, breakpoints) => {
let breakPointList = []
Object.keys(breakpoints).forEach(name => { breakPointList.push({ name, value: breakpoints[name] }) })
const sortBreakPointList = breakPointList.sort((a, b) => size(a.value).value > size(b.value).value).map(d => d.value === 0 ? { name: d.name, value: '0px' } : d)
- 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"