just-paja/radio-drama-queen

View on GitHub

Showing 29 of 100 total issues

File Category.jsx has 279 lines of code (exceeds 250 allowed). Consider refactoring.
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'
Severity: Minor
Found in src/soundCategories/components/Category.jsx - About 2 hrs to fix

    Function render has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render () {
        const {
          boardUuid,
          canDrop,
          classes,
    Severity: Major
    Found in src/soundCategories/components/Category.jsx - About 2 hrs to fix

      Function render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render () {
          const {
            categoryUuid,
            classes,
            focusableRef,
      Severity: Minor
      Found in src/soundCategories/components/CategoryItem.jsx - About 2 hrs to fix

        Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render () {
            const {
              classes,
              focusableRef,
              selectable,
        Severity: Minor
        Found in src/soundCategories/components/SoundSelectionItem.jsx - About 1 hr to fix

          Function render has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render () {
              const { board, classes, handleSubmit } = this.props
              return (
                <Form
                  className={classes.container}
          Severity: Minor
          Found in src/soundCategories/components/SoundAddDialog.jsx - About 1 hr to fix

            Function render has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render () {
                const { categories, focusedCategory, onBoardCreate, openDialogs } = this.props
                if (openDialogs) {
                  return null
                }
            Severity: Minor
            Found in src/soundWorkspaces/components/BoardShortcuts.jsx - About 1 hr to fix

              Function render has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render () {
                  const { classes, filterErrors, filterUsed, search } = this.props
                  return (
                    <div className={classes.container}>
                      <Input
              Severity: Minor
              Found in src/soundGallery/components/GallerySearch.jsx - About 1 hr to fix

                Function render has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render () {
                    const {
                      classes,
                      input,
                      type,
                Severity: Minor
                Found in src/components/Input.jsx - About 1 hr to fix

                  Function getFrags has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function getFrags (text, searchFragments) {
                    const lowerCaseText = text.toLowerCase()
                    return searchFragments
                      .reduce((acc, fragText) => {
                        const results = []
                  Severity: Minor
                  Found in src/components/HighlightText.jsx - About 1 hr to fix

                    Function handleKeyDown has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                    Open

                      handleKeyDown (event) {
                        if (event.key === 'ArrowDown') {
                          this.moveDown()
                        } else if (event.key === 'ArrowUp') {
                          this.moveUp()
                    Severity: Minor
                    Found in src/soundCategories/components/Category.jsx - About 1 hr to fix

                    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

                    export const matchSoundLoadFinish = (routine, uuid) => (action) => {
                      if (action) {
                        if (action.type === routine.FAILURE) {
                          return !uuid || (action.meta && action.meta.uuid === uuid)
                        }
                    Severity: Minor
                    Found in src/sounds/sagas/soundLoad.js - About 1 hr to fix

                    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

                    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))
                    Severity: Minor
                    Found in schema/validators.js - About 1 hr to fix

                      Function renderContent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        renderContent () {
                          const { activeStory, focusedStory, onStorySelect, stories } = this.props
                          if (stories.length === 0) {
                            return (
                              <CanvasMessage heading='No recent stories'>
                      Severity: Minor
                      Found in src/soundStories/components/StoryList.jsx - About 1 hr to fix

                        Function cacheFile has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        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$/)) {
                        Severity: Minor
                        Found in src/LocalAssetsManager.js - About 1 hr to fix

                          Function createMainWindow has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function createMainWindow (development) {
                            const mainWindow = new BrowserWindow({
                              height: 600,
                              // icon: path.join(__dirname, '..', 'public', 'favicon.png'),
                              minHeight: 320,
                          Severity: Minor
                          Found in src/electron/createMainWindow.js - About 1 hr to fix

                            Function cacheFile has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function cacheFile (url) {
                              const cachePath = getCachePath(url)
                            
                              if (jetpack.exists(cachePath) === 'file') {
                                return Promise.resolve(cachePath)
                            Severity: Minor
                            Found in src/electron/jsonCache.js - About 1 hr to fix

                              Function downloadSound has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                downloadSound (soundData) {
                                  const { path } = soundData
                                  const cachePath = this.getCachePath(path)
                                  return new Promise((resolve, reject) => {
                                    let res
                              Severity: Minor
                              Found in src/electron/SoundStorage.js - About 1 hr to fix

                                Function updateSound has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  updateSound: (soundData) => {
                                    if (!soundData) {
                                      return Promise.reject(new Error('You must pass some sound data'))
                                    }
                                
                                
                                Severity: Minor
                                Found in src/electron/workers/updateSound.js - About 1 hr to fix

                                  Function render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    render () {
                                      const { disabled, horizontal } = this.props
                                      if (disabled) {
                                        return null
                                      }
                                  Severity: Minor
                                  Found in src/components/ListShortcuts.jsx - About 1 hr to fix

                                    Function normalizeStoryState has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function normalizeStoryState (state, story) {
                                      const { name, uuid, entities, ...nextState } = story
                                      if (!entities) {
                                        return {
                                          ...state,
                                    Severity: Minor
                                    Found in src/reducers/index.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language