quran/quran.com-frontend

View on GitHub
src/components/Audioplayer/RepeatDropdown/index.js

Summary

Maintainability
D
2 days
Test Coverage

Function renderRangeAyahs has 72 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderRangeAyahs() {
    const { chapter, repeat, setRepeat } = this.props;
    const array = Array(chapter.versesCount).join().split(',');

    return (
Severity: Major
Found in src/components/Audioplayer/RepeatDropdown/index.js - About 2 hrs to fix

    File index.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { Component, PropTypes } from 'react';
    import * as customPropTypes from 'customPropTypes';
    import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
    import Popover from 'react-bootstrap/lib/Popover';
    import Nav from 'react-bootstrap/lib/Nav';
    Severity: Minor
    Found in src/components/Audioplayer/RepeatDropdown/index.js - About 2 hrs to fix

      Function render has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const { repeat } = this.props;
      
          const popover = (
            <Popover
      Severity: Minor
      Found in src/components/Audioplayer/RepeatDropdown/index.js - About 1 hr to fix

        Function renderTimes has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          renderTimes() {
            const { repeat, setRepeat, intl } = this.props;
            const times = Array(10).join().split(',');
        
            return (
        Severity: Minor
        Found in src/components/Audioplayer/RepeatDropdown/index.js - About 1 hr to fix

          Function renderSingleAyah has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            renderSingleAyah() {
              const { repeat, setRepeat, chapter } = this.props;
              const array = Array(chapter.versesCount).join().split(',');
          
              return (
          Severity: Minor
          Found in src/components/Audioplayer/RepeatDropdown/index.js - About 1 hr to fix

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

                      <FormControl
                        componentClass="select"
                        value={repeat.times}
                        onChange={event =>
                          setRepeat({
            Severity: Major
            Found in src/components/Audioplayer/RepeatDropdown/index.js and 1 other location - About 1 hr to fix
            src/components/Audioplayer/RepeatDropdown/index.js on lines 97..115

            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

                        <FormControl
                          componentClass="select"
                          value={repeat.to}
                          onChange={event =>
                            setRepeat({ ...repeat, to: parseInt(event.target.value, 10) })}
            Severity: Major
            Found in src/components/Audioplayer/RepeatDropdown/index.js and 1 other location - About 1 hr to fix
            src/components/Audioplayer/RepeatDropdown/index.js on lines 211..231

            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

                              if (index + 1 < chapter.versesCount) { // Exclude last verse
                                options.push(
                                  <option key={index} value={index + 1}>
                                    {index + 1}
                                  </option>
            Severity: Minor
            Found in src/components/Audioplayer/RepeatDropdown/index.js and 1 other location - About 55 mins to fix
            src/components/Audioplayer/RepeatDropdown/index.js on lines 105..111

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

            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

                              if ((repeat.from ? repeat.from : 1) < index + 1 && index + 1 <= chapter.versesCount) { // eslint-disable-line max-len
                                options.push(
                                  <option key={index} value={index + 1}>
                                    {index + 1}
                                  </option>
            Severity: Minor
            Found in src/components/Audioplayer/RepeatDropdown/index.js and 1 other location - About 55 mins to fix
            src/components/Audioplayer/RepeatDropdown/index.js on lines 76..82

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

            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

                        {times.map((ayah, index) => (
                          <option key={index} value={index + 1}>
                            {index + 1}
                          </option>
                        ))}
            Severity: Minor
            Found in src/components/Audioplayer/RepeatDropdown/index.js and 1 other location - About 55 mins to fix
            src/components/Audioplayer/RepeatDropdown/index.js on lines 146..150

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

            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

                      {array.map((ayah, index) => (
                        <option key={index} value={index + 1}>
                          {index + 1}
                        </option>
                      ))}
            Severity: Minor
            Found in src/components/Audioplayer/RepeatDropdown/index.js and 1 other location - About 55 mins to fix
            src/components/Audioplayer/RepeatDropdown/index.js on lines 226..230

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

            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

                        <NavItem eventKey={2} title="Range" className={style.pill}>
                          <LocaleFormattedMessage
                            id="player.repeat.range"
                            defaultMessage="Range"
                          />
            Severity: Minor
            Found in src/components/Audioplayer/RepeatDropdown/index.js and 1 other location - About 55 mins to fix
            src/components/Audioplayer/RepeatDropdown/index.js on lines 167..172

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

            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

                        <NavItem eventKey={1} title="Single Ayah" className={style.pill}>
                          <LocaleFormattedMessage
                            id="player.repeat.single"
                            defaultMessage="Single"
                          />
            Severity: Minor
            Found in src/components/Audioplayer/RepeatDropdown/index.js and 1 other location - About 55 mins to fix
            src/components/Audioplayer/RepeatDropdown/index.js on lines 173..178

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

            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

            There are no issues that match your filters.

            Category
            Status