quran/quran.com-frontend

View on GitHub

Showing 176 of 176 total issues

Avoid too many return statements within this function.
Open

      return {
        ...state,
        current,
        loaded: true,
        loading: false,
Severity: Major
Found in src/redux/modules/verses.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return {
            ...state,
            loadingTranslations: true
          };
    Severity: Major
    Found in src/redux/modules/options.js - About 30 mins to fix

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

                <li>
                  <a
                    href="http://salah.com/"
                    target="_blank"
                    rel="noopener noreferrer"
      Severity: Major
      Found in src/components/GlobalSidebar/index.js and 9 other locations - About 30 mins to fix
      src/components/Footer/index.js on lines 61..70
      src/components/Footer/index.js on lines 71..80
      src/components/Footer/index.js on lines 81..90
      src/components/Footer/index.js on lines 91..100
      src/components/GlobalNav/index.js on lines 52..61
      src/components/GlobalNav/index.js on lines 62..71
      src/components/GlobalNav/index.js on lines 72..81
      src/components/GlobalSidebar/index.js on lines 115..124
      src/components/GlobalSidebar/index.js on lines 135..144

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

      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

            expect(overlay.find('FormControl').first().props().value).to.eql(3);
      Severity: Minor
      Found in src/components/Audioplayer/RepeatDropdown/spec.js and 2 other locations - About 30 mins to fix
      src/components/Audioplayer/RepeatDropdown/spec.js on lines 65..65
      src/components/Audioplayer/RepeatDropdown/spec.js on lines 80..80

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

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

              <li>
                <a
                  href="http://salah.com/"
                  target="_blank"
                  rel="noopener noreferrer"
      Severity: Major
      Found in src/components/GlobalNav/index.js and 9 other locations - About 30 mins to fix
      src/components/Footer/index.js on lines 61..70
      src/components/Footer/index.js on lines 71..80
      src/components/Footer/index.js on lines 81..90
      src/components/Footer/index.js on lines 91..100
      src/components/GlobalNav/index.js on lines 52..61
      src/components/GlobalNav/index.js on lines 72..81
      src/components/GlobalSidebar/index.js on lines 115..124
      src/components/GlobalSidebar/index.js on lines 125..134
      src/components/GlobalSidebar/index.js on lines 135..144

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

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

              <li>
                <a
                  href="http://sunnah.com/"
                  target="_blank"
                  rel="noopener noreferrer"
      Severity: Major
      Found in src/components/GlobalNav/index.js and 9 other locations - About 30 mins to fix
      src/components/Footer/index.js on lines 61..70
      src/components/Footer/index.js on lines 71..80
      src/components/Footer/index.js on lines 81..90
      src/components/Footer/index.js on lines 91..100
      src/components/GlobalNav/index.js on lines 52..61
      src/components/GlobalNav/index.js on lines 62..71
      src/components/GlobalSidebar/index.js on lines 115..124
      src/components/GlobalSidebar/index.js on lines 125..134
      src/components/GlobalSidebar/index.js on lines 135..144

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

      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 {
                ...state,
                currentWord: action.word,
                currentTime
              };
      Severity: Major
      Found in src/redux/modules/audioplayer.js - About 30 mins to fix

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

                        <li>
                          <a
                            target="_blank"
                            rel="noopener noreferrer"
                            href="http://sunnah.com/"
        Severity: Major
        Found in src/components/Footer/index.js and 9 other locations - About 30 mins to fix
        src/components/Footer/index.js on lines 71..80
        src/components/Footer/index.js on lines 81..90
        src/components/Footer/index.js on lines 91..100
        src/components/GlobalNav/index.js on lines 52..61
        src/components/GlobalNav/index.js on lines 62..71
        src/components/GlobalNav/index.js on lines 72..81
        src/components/GlobalSidebar/index.js on lines 115..124
        src/components/GlobalSidebar/index.js on lines 125..134
        src/components/GlobalSidebar/index.js on lines 135..144

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

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

                        <li>
                          <a
                            target="_blank"
                            rel="noopener noreferrer"
                            href="http://quranicaudio.com/"
        Severity: Major
        Found in src/components/Footer/index.js and 9 other locations - About 30 mins to fix
        src/components/Footer/index.js on lines 61..70
        src/components/Footer/index.js on lines 71..80
        src/components/Footer/index.js on lines 91..100
        src/components/GlobalNav/index.js on lines 52..61
        src/components/GlobalNav/index.js on lines 62..71
        src/components/GlobalNav/index.js on lines 72..81
        src/components/GlobalSidebar/index.js on lines 115..124
        src/components/GlobalSidebar/index.js on lines 125..134
        src/components/GlobalSidebar/index.js on lines 135..144

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

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

                  <li>
                    <a
                      href="http://sunnah.com/"
                      target="_blank"
                      rel="noopener noreferrer"
        Severity: Major
        Found in src/components/GlobalSidebar/index.js and 9 other locations - About 30 mins to fix
        src/components/Footer/index.js on lines 61..70
        src/components/Footer/index.js on lines 71..80
        src/components/Footer/index.js on lines 81..90
        src/components/Footer/index.js on lines 91..100
        src/components/GlobalNav/index.js on lines 52..61
        src/components/GlobalNav/index.js on lines 62..71
        src/components/GlobalNav/index.js on lines 72..81
        src/components/GlobalSidebar/index.js on lines 115..124
        src/components/GlobalSidebar/index.js on lines 125..134

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

        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 {
                ...state,
                currentWord: word
              };
        Severity: Major
        Found in src/redux/modules/audioplayer.js - About 30 mins to fix

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

                          <li>
                            <a
                              target="_blank"
                              rel="noopener noreferrer"
                              href="http://salah.com/"
          Severity: Major
          Found in src/components/Footer/index.js and 9 other locations - About 30 mins to fix
          src/components/Footer/index.js on lines 61..70
          src/components/Footer/index.js on lines 81..90
          src/components/Footer/index.js on lines 91..100
          src/components/GlobalNav/index.js on lines 52..61
          src/components/GlobalNav/index.js on lines 62..71
          src/components/GlobalNav/index.js on lines 72..81
          src/components/GlobalSidebar/index.js on lines 115..124
          src/components/GlobalSidebar/index.js on lines 125..134
          src/components/GlobalSidebar/index.js on lines 135..144

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

          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 {
                  ...state,
                  currentVerse: nextId,
                  currentFile: state.files[chapterId][nextId],
                  currentTime: 0
          Severity: Major
          Found in src/redux/modules/audioplayer.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return {
                    ...state,
                    currentFile: action.file
                  };
            Severity: Major
            Found in src/redux/modules/audioplayer.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return {
                      ...state,
                      loadingTranslations: false,
                      options: {
                        ...state.options,
              Severity: Major
              Found in src/redux/modules/options.js - About 30 mins to fix

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

                        <li>
                          <a
                            href="https://quranicaudio.com/"
                            target="_blank"
                            rel="noopener noreferrer"
                Severity: Major
                Found in src/components/GlobalNav/index.js and 9 other locations - About 30 mins to fix
                src/components/Footer/index.js on lines 61..70
                src/components/Footer/index.js on lines 71..80
                src/components/Footer/index.js on lines 81..90
                src/components/Footer/index.js on lines 91..100
                src/components/GlobalNav/index.js on lines 62..71
                src/components/GlobalNav/index.js on lines 72..81
                src/components/GlobalSidebar/index.js on lines 115..124
                src/components/GlobalSidebar/index.js on lines 125..134
                src/components/GlobalSidebar/index.js on lines 135..144

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

                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 {
                        ...state,
                        currentWord: action.word,
                        currentVerse: nextId,
                        isPlaying: false,
                Severity: Major
                Found in src/redux/modules/audioplayer.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                    return {};
                  Severity: Major
                  Found in src/containers/Surah/connect.js - About 30 mins to fix

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

                              <li>
                                <a
                                  href="https://quranicaudio.com/"
                                  target="_blank"
                                  rel="noopener noreferrer"
                    Severity: Major
                    Found in src/components/GlobalSidebar/index.js and 9 other locations - About 30 mins to fix
                    src/components/Footer/index.js on lines 61..70
                    src/components/Footer/index.js on lines 71..80
                    src/components/Footer/index.js on lines 81..90
                    src/components/Footer/index.js on lines 91..100
                    src/components/GlobalNav/index.js on lines 52..61
                    src/components/GlobalNav/index.js on lines 62..71
                    src/components/GlobalNav/index.js on lines 72..81
                    src/components/GlobalSidebar/index.js on lines 125..134
                    src/components/GlobalSidebar/index.js on lines 135..144

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

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

                                    <li>
                                      <a
                                        target="_blank"
                                        rel="noopener noreferrer"
                                        href="http://corpus.quran.com/wordbyword.jsp"
                    Severity: Major
                    Found in src/components/Footer/index.js and 9 other locations - About 30 mins to fix
                    src/components/Footer/index.js on lines 61..70
                    src/components/Footer/index.js on lines 71..80
                    src/components/Footer/index.js on lines 81..90
                    src/components/GlobalNav/index.js on lines 52..61
                    src/components/GlobalNav/index.js on lines 62..71
                    src/components/GlobalNav/index.js on lines 72..81
                    src/components/GlobalSidebar/index.js on lines 115..124
                    src/components/GlobalSidebar/index.js on lines 125..134
                    src/components/GlobalSidebar/index.js on lines 135..144

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

                    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