Showing 29 of 100 total issues
File Category.jsx
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Card from '@material-ui/core/Card'
import CardActions from '@material-ui/core/CardActions'
import CardContent from '@material-ui/core/CardContent'
import classnames from 'classnames'
import List from '@material-ui/core/List'
Function render
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const {
boardUuid,
canDrop,
classes,
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const {
categoryUuid,
classes,
focusableRef,
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const {
classes,
focusableRef,
selectable,
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { board, classes, handleSubmit } = this.props
return (
<Form
className={classes.container}
Function render
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { categories, focusedCategory, onBoardCreate, openDialogs } = this.props
if (openDialogs) {
return null
}
Function render
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { classes, filterErrors, filterUsed, search } = this.props
return (
<div className={classes.container}>
<Input
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const {
classes,
input,
type,
Function getFrags
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getFrags (text, searchFragments) {
const lowerCaseText = text.toLowerCase()
return searchFragments
.reduce((acc, fragText) => {
const results = []
Function handleKeyDown
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
handleKeyDown (event) {
if (event.key === 'ArrowDown') {
this.moveDown()
} else if (event.key === 'ArrowUp') {
this.moveUp()
- 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 matchSoundLoadFinish
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
export const matchSoundLoadFinish = (routine, uuid) => (action) => {
if (action) {
if (action.type === routine.FAILURE) {
return !uuid || (action.meta && action.meta.uuid === uuid)
}
- 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 validateDeep
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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))
Function renderContent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderContent () {
const { activeStory, focusedStory, onStorySelect, stories } = this.props
if (stories.length === 0) {
return (
<CanvasMessage heading='No recent stories'>
Function cacheFile
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const cacheFile = (url, cachePath) => {
if (!fs) {
return Promise.reject(new Error('Not available in this environment'))
}
if (jetpack.exists(cachePath) === 'file' && !cachePath.match(/\.json$/)) {
Function createMainWindow
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function createMainWindow (development) {
const mainWindow = new BrowserWindow({
height: 600,
// icon: path.join(__dirname, '..', 'public', 'favicon.png'),
minHeight: 320,
Function cacheFile
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function cacheFile (url) {
const cachePath = getCachePath(url)
if (jetpack.exists(cachePath) === 'file') {
return Promise.resolve(cachePath)
Function downloadSound
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
downloadSound (soundData) {
const { path } = soundData
const cachePath = this.getCachePath(path)
return new Promise((resolve, reject) => {
let res
Function updateSound
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateSound: (soundData) => {
if (!soundData) {
return Promise.reject(new Error('You must pass some sound data'))
}
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const { disabled, horizontal } = this.props
if (disabled) {
return null
}
Function normalizeStoryState
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function normalizeStoryState (state, story) {
const { name, uuid, entities, ...nextState } = story
if (!entities) {
return {
...state,