just-paja/radio-drama-queen

View on GitHub

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()
Severity: Minor
Found in src/soundCategories/components/Category.jsx - About 1 hr to fix

    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))
    Severity: Minor
    Found in schema/validators.js - About 45 mins 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 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) {
    Severity: Minor
    Found in src/soundCategories/sagas/soundLoad.js - About 45 mins 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 SoundStatusIcon has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const SoundStatusIcon = ({
      error,
      loading,
      playing,
      valid,
    Severity: Minor
    Found in src/sounds/components/SoundStatusIcon.jsx - About 45 mins 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 renderButton has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    function renderButton (classes, Icon, title, value, disabled) {
    Severity: Minor
    Found in src/soundWorkspaces/components/WorkspaceSelection.jsx - About 35 mins to fix

      Function render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        render () {
          const {
            classes,
            input,
            type,
      Severity: Minor
      Found in src/components/Input.jsx - About 35 mins 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

      Avoid too many return statements within this function.
      Open

            return [...acc, frag]
      Severity: Major
      Found in src/components/HighlightText.jsx - About 30 mins to fix

        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)
        Severity: Minor
        Found in src/soundWorkspaces/sagas/soundPicker.js - About 25 mins 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 GalleryTargetComponent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        const GalleryTargetComponent = ({
          classes,
          board,
          category,
          onGoBack
        Severity: Minor
        Found in src/soundGallery/components/GalleryTarget.jsx - About 25 mins 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

        Severity
        Category
        Status
        Source
        Language