Showing 251 of 251 total issues

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

  componentDidMount() {
    if (!sessionStorage.getItem('gistoReleases')) {
      fetch('https://api.github.com/repos/Gisto/Gisto/releases/latest')
        .then((response) => response.json())
        .then((data) => {
Severity: Minor
Found in docs/src/components/Downloads.js - About 1 hr to fix

    Function handleDownload has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function handleDownload(win) {
      win.webContents.session.on('will-download', (event, item, sender) => {
        const isUpdateUrl = includes(
          ['https://github.com/Gisto/Gisto/releases/download/'],
          head(item.getURLChain())
    Severity: Minor
    Found in src/electron/main/helpers.js - About 1 hr to fix

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

      Main.propTypes = {
        edit: PropTypes.bool,
        isCreateNew: PropTypes.bool,
        getSnippets: PropTypes.func,
        getStarredSnippets: PropTypes.func,
      Severity: Major
      Found in src/components/layout/Main.js and 2 other locations - About 1 hr to fix
      docs/src/html.js on lines 89..96
      src/components/layout/headers/MainHeader.js on lines 166..173

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

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

      MainHeader.propTypes = {
        loading: PropTypes.bool,
        edit: PropTypes.bool,
        rateLimit: PropTypes.object,
        settings: PropTypes.object,
      Severity: Major
      Found in src/components/layout/headers/MainHeader.js and 2 other locations - About 1 hr to fix
      docs/src/html.js on lines 89..96
      src/components/layout/Main.js on lines 82..89

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

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

      HTML.propTypes = {
        htmlAttributes: PropTypes.object,
        headComponents: PropTypes.array,
        bodyAttributes: PropTypes.object,
        preBodyComponents: PropTypes.array,
      Severity: Major
      Found in docs/src/html.js and 2 other locations - About 1 hr to fix
      src/components/layout/Main.js on lines 82..89
      src/components/layout/headers/MainHeader.js on lines 166..173

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

      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 render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const { lightText, colorDanger } = this.props.theme;
          const {
            children,
            size = 22,
      Severity: Minor
      Found in src/components/common/UtilityIcon.js - About 1 hr to fix

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

        export const users = (state = initialState, action) => {
          switch (action.type) {
            case AT.GET_USER.SUCCESS: {
              return set('user', action.payload, state);
            }
        Severity: Major
        Found in src/reducers/users.js and 1 other location - About 1 hr to fix
        src/reducers/emoji.js on lines 8..18

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

        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 emoji = (state = initialState, action) => {
          switch (action.type) {
            case AT.GET_EMOJI.SUCCESS: {
              return set('emoji', action.payload, state);
            }
        Severity: Major
        Found in src/reducers/emoji.js and 1 other location - About 1 hr to fix
        src/reducers/users.js on lines 8..18

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

        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 render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            return (
              <Wrapper>
                <img src={ logoImg } width="80" alt=""/>
                <h2>About Gisto</h2>
        Severity: Minor
        Found in src/components/layout/content/About.js - About 1 hr to fix

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

                children: [
                  <option key={'1'}>1</option>,
                  <option key={'2'}>2</option>,
                  <option key={'bla-bla'}>bla-bla</option>
                ],
          Severity: Major
          Found in __tests__/components/common/controls/Select.spec.js and 2 other locations - About 1 hr to fix
          __tests__/components/common/controls/Select.spec.js on lines 7..11
          __tests__/components/common/controls/Select.spec.js on lines 32..36

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

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

                    <div className="w-col w-col-4 w-clearfix feat">
                      <img src={ searchImg } alt="Search"/>
          
                      <h3>Search</h3>
          
          
          Severity: Major
          Found in docs/src/pages/features.js and 3 other locations - About 1 hr to fix
          docs/src/pages/features.js on lines 91..102
          docs/src/pages/features.js on lines 121..132
          docs/src/pages/index.js on lines 66..76

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

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

                    <div className="w-col w-col-4 w-clearfix feat">
                      <img src={ dashboardImage } alt="Dashboard"/>
          
                      <h3>Dashboard</h3>
          
          
          Severity: Major
          Found in docs/src/pages/features.js and 3 other locations - About 1 hr to fix
          docs/src/pages/features.js on lines 37..47
          docs/src/pages/features.js on lines 121..132
          docs/src/pages/index.js on lines 66..76

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

          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

            test('addTempFile action should be created', () => {
              expect(snippetsActions.addTempFile('a', 'b')).toEqual({
                type: AT.ADD_TEMP_FILE,
                payload: {
                  fileContent: "b",
          Severity: Major
          Found in __tests__/actions/snippetsActions.spec.js and 1 other location - About 1 hr to fix
          __tests__/actions/snippetsActions.spec.js on lines 254..262

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

          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

          test('filterSnippetsByStatus action should be created', () => {
            expect(snippetsActions.toggleCollapse('123123', 'file.txt')).toEqual({
              type: AT.TOGGLE_FILE_COLLAPSE,
              payload: {
                snippetId: '123123',
          Severity: Major
          Found in __tests__/actions/snippetsActions.spec.js and 1 other location - About 1 hr to fix
          __tests__/actions/snippetsActions.spec.js on lines 244..251

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

          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

                onChange: jest.fn(),children: [
                  <option key={'1'}>1</option>,
                  <option key={'2'}>2</option>,
                  <option key={'bla-bla'}>bla-bla</option>
                ]
          Severity: Major
          Found in __tests__/components/common/controls/Select.spec.js and 2 other locations - About 1 hr to fix
          __tests__/components/common/controls/Select.spec.js on lines 7..11
          __tests__/components/common/controls/Select.spec.js on lines 20..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 63.

          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

            children: [
              <option key={'1'}>1</option>,
              <option key={'2'}>2</option>,
              <option key={'bla-bla'}>bla-bla</option>
            ],
          Severity: Major
          Found in __tests__/components/common/controls/Select.spec.js and 2 other locations - About 1 hr to fix
          __tests__/components/common/controls/Select.spec.js on lines 20..24
          __tests__/components/common/controls/Select.spec.js on lines 32..36

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

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

                      <div className="w-col w-col-4 w-clearfix feat">
                        <img src={ searchImg } alt="Edit"/>
          
                        <h3>Search</h3>
          
          
          Severity: Major
          Found in docs/src/pages/index.js and 3 other locations - About 1 hr to fix
          docs/src/pages/features.js on lines 37..47
          docs/src/pages/features.js on lines 91..102
          docs/src/pages/features.js on lines 121..132

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

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

                    <div className="w-col w-col-4 w-clearfix feat">
                      <img src={ revisionsImage } alt="Revisions"/>
          
                      <h3>Revision browser</h3>
          
          
          Severity: Major
          Found in docs/src/pages/features.js and 3 other locations - About 1 hr to fix
          docs/src/pages/features.js on lines 37..47
          docs/src/pages/features.js on lines 91..102
          docs/src/pages/index.js on lines 66..76

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

          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 filterByFreeText has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const filterByFreeText = (snippets: ISnippet, filterText: string) => {
            try {
              new RegExp(filterText, 'gi');
            } catch (e) {
              return false;
          Severity: Minor
          Found in src/utils/snippets.ts - About 1 hr to fix

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

                  <div className="w-col w-col-4 w-clearfix">
                    <h3><b>why</b></h3>
            
                    <p>
                      <Logo/> started by fulfilling a lack of a syntax highlighted and cloud
            Severity: Major
            Found in docs/src/components/About.js and 1 other location - About 1 hr to fix
            docs/src/components/About.js on lines 33..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 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

            Severity
            Category
            Status
            Source
            Language