just-paja/radio-drama-queen

View on GitHub

Showing 100 of 100 total issues

Similar blocks of code found in 9 locations. Consider refactoring.
Open

  constructor (props) {
    super(props)
    this.handleMenuClose = this.handleMenuClose.bind(this)
    this.handleMenuOpen = this.handleMenuOpen.bind(this)
  }
Severity: Major
Found in src/components/ContextMenuControl.jsx and 8 other locations - About 1 hr to fix
src/soundStories/components/StoryContextMenu.jsx on lines 12..16
src/components/ContextMenuUncontrolled.jsx on lines 13..17
src/components/InputToggleButton.jsx on lines 13..17
src/components/withContextMenu.jsx on lines 10..14
src/soundBoards/components/BoardContextMenu.jsx on lines 13..17
src/soundCategories/components/Category.jsx on lines 66..70
src/soundCategories/components/SoundSelection.jsx on lines 22..26
src/soundWorkspaces/components/WorkspaceShortcuts.jsx on lines 13..17

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const WorkspaceSaveDialog = dialogForm({
  dialog: FORM_WORKSPACE_SAVE_AS,
  onSubmit: workspaceLoad.loadFrom,
  submitLabel: 'Save configuration',
  title: 'Save workspace configuration',
Severity: Major
Found in src/soundWorkspaces/components/WorkspaceSaveDialog.jsx and 1 other location - About 1 hr to fix
src/soundWorkspaces/components/WorkspaceLoadDialog.jsx on lines 19..27

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const WorkspaceLoadDialog = dialogForm({
  dialog: FORM_WORKSPACE_LOAD_FROM,
  onSubmit: workspaceLoad.loadFrom,
  submitLabel: 'Load configuration',
  title: 'Workspace configuration',
Severity: Major
Found in src/soundWorkspaces/components/WorkspaceLoadDialog.jsx and 1 other location - About 1 hr to fix
src/soundWorkspaces/components/WorkspaceSaveDialog.jsx on lines 19..27

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

      constructor (props) {
        super(props)
        this.handleMenuClose = this.handleMenuClose.bind(this)
        this.handleMenuOpen = this.handleMenuOpen.bind(this)
      }
Severity: Major
Found in src/components/withContextMenu.jsx and 8 other locations - About 1 hr to fix
src/soundStories/components/StoryContextMenu.jsx on lines 12..16
src/components/ContextMenuControl.jsx on lines 21..25
src/components/ContextMenuUncontrolled.jsx on lines 13..17
src/components/InputToggleButton.jsx on lines 13..17
src/soundBoards/components/BoardContextMenu.jsx on lines 13..17
src/soundCategories/components/Category.jsx on lines 66..70
src/soundCategories/components/SoundSelection.jsx on lines 22..26
src/soundWorkspaces/components/WorkspaceShortcuts.jsx on lines 13..17

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 9 locations. Consider refactoring.
Open

  constructor (props) {
    super(props)
    this.handleKeyDown = this.handleKeyDown.bind(this)
    this.handleSelect = this.handleSelect.bind(this)
  }
Severity: Major
Found in src/soundCategories/components/SoundSelection.jsx and 8 other locations - About 1 hr to fix
src/soundStories/components/StoryContextMenu.jsx on lines 12..16
src/components/ContextMenuControl.jsx on lines 21..25
src/components/ContextMenuUncontrolled.jsx on lines 13..17
src/components/InputToggleButton.jsx on lines 13..17
src/components/withContextMenu.jsx on lines 10..14
src/soundBoards/components/BoardContextMenu.jsx on lines 13..17
src/soundCategories/components/Category.jsx on lines 66..70
src/soundWorkspaces/components/WorkspaceShortcuts.jsx on lines 13..17

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

function NoOptionsMessage (props) {
  return (
    <Typography
      color='textSecondary'
      className={props.selectProps.classes.noOptionsMessage}
Severity: Major
Found in src/components/InputSelect.jsx and 1 other location - About 1 hr to fix
src/components/InputSelect.jsx on lines 146..156

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const CategoryRenameDialog = dialogForm({
  dialog: FORM_CATEGORY_RENAME,
  initialValues: state => categoryStore.getObject(state, getDialogMeta(state, FORM_CATEGORY_RENAME)),
  onSubmit: categoryRoutines.rename,
  title: 'Rename category'
Severity: Major
Found in src/soundCategories/components/CategoryRenameDialog.jsx and 1 other location - About 1 hr to fix
src/soundBoards/components/BoardRenameDialog.jsx on lines 19..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

export const BoardRenameDialog = dialogForm({
  dialog: FORM_BOARD_RENAME,
  initialValues: state => boardStore.getObject(state, getDialogMeta(state, FORM_BOARD_RENAME)),
  onSubmit: boardRoutines.rename,
  title: 'Rename board'
Severity: Major
Found in src/soundBoards/components/BoardRenameDialog.jsx and 1 other location - About 1 hr to fix
src/soundCategories/components/CategoryRenameDialog.jsx on lines 19..24

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 61.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              <FormControlLabel
                control={(
                  <Checkbox
                    className={classes.input}
                    checked={filterErrors}
      Severity: Major
      Found in src/soundGallery/components/GallerySearch.jsx and 1 other location - About 1 hr to fix
      src/soundGallery/components/GallerySearch.jsx on lines 65..75

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 59.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

              <FormControlLabel
                control={(
                  <Checkbox
                    className={classes.input}
                    checked={filterUsed}
      Severity: Major
      Found in src/soundGallery/components/GallerySearch.jsx and 1 other location - About 1 hr to fix
      src/soundGallery/components/GallerySearch.jsx on lines 76..86

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 59.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            icon: {
              height: theme.spacing(2),
              marginLeft: theme.spacing(1),
              marginRight: theme.spacing(1),
              width: theme.spacing(2)
          Severity: Major
          Found in src/soundCategories/components/SoundCategoryIconButton.jsx and 1 other location - About 1 hr to fix
          src/components/ContextMenuItem.jsx on lines 27..32

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 58.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

            icon: {
              width: theme.spacing(2),
              height: theme.spacing(2),
              fontSize: theme.spacing(2),
              marginRight: theme.spacing(1)
          Severity: Major
          Found in src/components/ContextMenuItem.jsx and 1 other location - About 1 hr to fix
          src/soundCategories/components/SoundCategoryIconButton.jsx on lines 18..23

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 58.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          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

              Identical blocks of code found in 3 locations. Consider refactoring.
              Open

                  const failAndCleanUp = (error) => {
                    stream.close()
                    return jetpack.removeAsync(cachePath)
                      .then(() => reject(error))
                      .catch(reject)
              Severity: Major
              Found in src/LocalAssetsManager.js and 2 other locations - About 1 hr to fix
              src/electron/SoundStorage.js on lines 66..71
              src/electron/jsonCache.js on lines 22..27

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 57.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 3 locations. Consider refactoring.
              Open

                  const failAndCleanUp = (error) => {
                    stream.close()
                    return jetpack.removeAsync(cachePath)
                      .then(() => reject(error))
                      .catch(reject)
              Severity: Major
              Found in src/electron/jsonCache.js and 2 other locations - About 1 hr to fix
              src/electron/SoundStorage.js on lines 66..71
              src/LocalAssetsManager.js on lines 36..41

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 57.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language