swashata/php-number-to-word-india

View on GitHub

Showing 10 of 10 total issues

Method convertNumber has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

private function convertNumber( $number ) {
// Init the return
$word = array();
// Lets start with crore
$crore_quotient = floor( $number / $this->croreDivisor );
Severity: Minor
Found in src/NTWIndia.php - About 1 hr to fix

    Function convertNumber has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    private function convertNumber( $number ) {
    // Init the return
    $word = array();
    // Lets start with crore
    $crore_quotient = floor( $number / $this->croreDivisor );
    Severity: Minor
    Found in src/NTWIndia.php - About 1 hr to fix

    Function numToWordSmall has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

    public function numToWordSmall( $number ) {
    // Check if number is numeric
    if ( ! is_numeric( $number ) ) {
    throw new Exception\NTWIndiaInvalidNumber( 'Valid number not given.' );
    }
    Severity: Minor
    Found in src/NTWIndia.php - About 1 hr to fix

    Method numToWordSmall has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    public function numToWordSmall( $number ) {
    // Check if number is numeric
    if ( ! is_numeric( $number ) ) {
    throw new Exception\NTWIndiaInvalidNumber( 'Valid number not given.' );
    }
    Severity: Minor
    Found in src/NTWIndia.php - About 1 hr to fix

      Function numToWord has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      public function numToWord( $number ) {
      /**
      * Check if a valid number is passed
      *
      * If not then log a warning
      Severity: Minor
      Found in src/NTWIndia.php - About 45 mins to fix

      Avoid too many return statements within this method.
      Open

      return $this->numToWord['90'] . ' ' . $this->numToWord[ $lastCharacter ];
      Severity: Major
      Found in src/NTWIndia.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

        return $this->numToWord['50'] . ' ' . $this->numToWord[ $lastCharacter ];
        Severity: Major
        Found in src/NTWIndia.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

          return $this->numToWord['80'] . ' ' . $this->numToWord[ $lastCharacter ];
          Severity: Major
          Found in src/NTWIndia.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

            return $this->numToWord['70'] . ' ' . $this->numToWord[ $lastCharacter ];
            Severity: Major
            Found in src/NTWIndia.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

              return $this->numToWord['60'] . ' ' . $this->numToWord[ $lastCharacter ];
              Severity: Major
              Found in src/NTWIndia.php - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language