Showing 29 of 100 total issues
Function handleKeyDown
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleKeyDown (event) {
if (event.key === 'ArrowDown') {
this.moveDown()
} else if (event.key === 'ArrowUp') {
this.moveUp()
Function validateDeep
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function validateDeep (file, parentName) {
const base = path.dirname(file)
const dirName = path.basename(base)
const mod = jetpack.read(file, 'json')
const modName = parentName ? `${parentName}/${dirName}` : (mod ? mod.name : path.basename(dirName))
- 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 useCategorySettings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function * useCategorySettings (categoryUuid, soundUuid) {
const category = yield select(categoryStore.getObject, categoryUuid)
if (category) {
const sound = yield select(soundStore.getObject, soundUuid)
if (sound.loop !== category.loop) {
- 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 SoundStatusIcon
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const SoundStatusIcon = ({
error,
loading,
playing,
valid,
- 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 renderButton
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function renderButton (classes, Icon, title, value, disabled) {
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render () {
const {
classes,
input,
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
Avoid too many return
statements within this function. Open
return [...acc, frag]
Function setTarget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function * setTarget ({ payload, meta }) {
if (meta && payload === VIEW_LIBRARY && meta.target) {
yield put(galleryTarget.set(meta.target))
} else {
const target = yield select(getGalleryTarget)
- 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 GalleryTargetComponent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const GalleryTargetComponent = ({
classes,
board,
category,
onGoBack
- 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"