Showing 251 of 251 total issues

Avoid too many return statements within this function.
Open

      return snippets;
Severity: Major
Found in src/utils/snippets.ts - About 30 mins to fix

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

          API.patch(`${getApiUrl('/api/v3')}/gists/${action.payload.id}`)
            .set(_headers())
            .send(action.payload.snippet)
    Severity: Major
    Found in src/middlewares/gitHubAPI.js and 5 other locations - About 30 mins to fix
    src/middlewares/gitHubAPI.js on lines 182..194
    src/middlewares/gitHubAPI.js on lines 224..242
    src/middlewares/gitHubAPI.js on lines 267..280
    src/middlewares/gitHubAPI.js on lines 302..314
    src/middlewares/gitHubAPI.js on lines 319..321

    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 50.

    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

    Avoid too many return statements within this function.
    Open

        return '';
    Severity: Major
    Found in src/components/layout/sidebar/Sidebar.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return set(['comments', action.meta.id], comments, state);
      Severity: Major
      Found in src/reducers/snippets.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return set(['rateLimit', 'loading'], true, state);
        Severity: Major
        Found in src/reducers/ui.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return set(['filter', 'tags'], without([action.payload.tag], state.filter.tags), state);
          Severity: Major
          Found in src/reducers/snippets.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return flow([
                    set(['filter', 'text'], ''),
                    set(['filter', 'tags'], []),
                    set(['filter', 'language'], ''),
                    set(['filter', 'status'], action.payload.status),
            Severity: Major
            Found in src/reducers/snippets.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return set(['comments', action.meta.id], action.payload, state);
              Severity: Major
              Found in src/reducers/snippets.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return filter({ truncated: true }, sortedSnippets);
                Severity: Major
                Found in src/utils/snippets.ts - About 30 mins to fix

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

                        API.get(`${getApiUrl('/api/v3')}/gists/${action.payload.id}/comments`)
                          .set(_headers())
                          .end((error, result) => {
                            errorHandler(error, result);
                  
                  
                  Severity: Major
                  Found in src/middlewares/gitHubAPI.js and 5 other locations - About 30 mins to fix
                  src/middlewares/gitHubAPI.js on lines 182..194
                  src/middlewares/gitHubAPI.js on lines 224..242
                  src/middlewares/gitHubAPI.js on lines 267..280
                  src/middlewares/gitHubAPI.js on lines 286..288
                  src/middlewares/gitHubAPI.js on lines 319..321

                  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 50.

                  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

                  Avoid too many return statements within this function.
                  Open

                        return 'untagged';
                  Severity: Major
                  Found in src/components/layout/sidebar/Sidebar.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return set(['edit', 'files', action.payload.uuid, 'delete'], true, state);
                    Severity: Major
                    Found in src/reducers/snippets.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return set(['comments', action.meta.id], [], state);
                      Severity: Major
                      Found in src/reducers/snippets.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          return sortedSnippets;
                        Severity: Major
                        Found in src/utils/snippets.ts - About 30 mins to fix

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

                          describe('COMPONENTS - <Sidebar>', () => {
                            test('render Sidebar', () => {
                              const component = setup();
                          
                              expect(component).toMatchSnapshot();
                          Severity: Major
                          Found in __tests__/components/layout/sidebar/Sidebar.spec.js and 11 other locations - About 30 mins to fix
                          __tests__/components/common/Languagelist.spec.js on lines 15..21
                          __tests__/components/layout/App.spec.js on lines 11..17
                          __tests__/components/layout/KeyBindings.spec.js on lines 5..11
                          __tests__/components/layout/Updater.js on lines 9..15
                          __tests__/components/layout/content/About.spec.js on lines 14..20
                          __tests__/components/layout/content/NewSnippet.spec.js on lines 19..25
                          __tests__/components/layout/content/Settings.spec.js on lines 9..15
                          __tests__/components/layout/content/settings/Editor.spec.js on lines 10..16
                          __tests__/components/layout/content/settings/Snippets.spec.js on lines 10..16
                          __tests__/components/layout/headers/SubHeader.spec.js on lines 9..15
                          __tests__/components/layout/sidebar/SnippetsList.spec.js on lines 9..15

                          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 50.

                          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 12 locations. Consider refactoring.
                          Open

                          describe('COMPONENTS - <EditorSettings>', () => {
                            test('render EditorSettings', () => {
                              const component = setup();
                          
                              expect(component).toMatchSnapshot();
                          Severity: Major
                          Found in __tests__/components/layout/content/settings/Editor.spec.js and 11 other locations - About 30 mins to fix
                          __tests__/components/common/Languagelist.spec.js on lines 15..21
                          __tests__/components/layout/App.spec.js on lines 11..17
                          __tests__/components/layout/KeyBindings.spec.js on lines 5..11
                          __tests__/components/layout/Updater.js on lines 9..15
                          __tests__/components/layout/content/About.spec.js on lines 14..20
                          __tests__/components/layout/content/NewSnippet.spec.js on lines 19..25
                          __tests__/components/layout/content/Settings.spec.js on lines 9..15
                          __tests__/components/layout/content/settings/Snippets.spec.js on lines 10..16
                          __tests__/components/layout/headers/SubHeader.spec.js on lines 9..15
                          __tests__/components/layout/sidebar/Sidebar.spec.js on lines 9..15
                          __tests__/components/layout/sidebar/SnippetsList.spec.js on lines 9..15

                          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 50.

                          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 6 locations. Consider refactoring.
                          Open

                                API.delete(`${getApiUrl('/api/v3')}/gists/${action.payload.id}`)
                                  .set(_headers())
                                  .end((error, result) => {
                                    errorHandler(error, result);
                          
                          
                          Severity: Major
                          Found in src/middlewares/gitHubAPI.js and 5 other locations - About 30 mins to fix
                          src/middlewares/gitHubAPI.js on lines 182..194
                          src/middlewares/gitHubAPI.js on lines 224..242
                          src/middlewares/gitHubAPI.js on lines 286..288
                          src/middlewares/gitHubAPI.js on lines 302..314
                          src/middlewares/gitHubAPI.js on lines 319..321

                          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 50.

                          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

                              const expected = initialState({
                                filter: {
                                  text: '',
                                  tags: ['HTML'],
                                  language: '',
                          Severity: Minor
                          Found in __tests__/reduceres/snippets.spec.js and 1 other location - About 30 mins to fix
                          __tests__/reduceres/snippets.spec.js on lines 180..189

                          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 50.

                          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

                          Avoid too many return statements within this function.
                          Open

                                return set(
                                  ['snippets', action.payload.id],
                                  snippetStructure(action.payload, state.starred),
                                  state
                                );
                          Severity: Major
                          Found in src/reducers/snippets.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return set('edit', {}, state);
                            Severity: Major
                            Found in src/reducers/snippets.js - About 30 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language