kwn/number-to-words

View on GitHub

Showing 211 of 211 total issues

Avoid too many return statements within this method.
Open

        return $return;
Severity: Major
Found in src/Legacy/Numbers/Words/Locale/Dk.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return 2;
    Severity: Major
    Found in src/CurrencyTransformer/LatvianCurrencyTransformer.php - About 30 mins to fix

      Function convertIntegerPart has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function convertIntegerPart($number)
          {
              $result = '';
      
              if ($number >= 1000000000000) {
      Severity: Minor
      Found in src/Legacy/Numbers/Words/Locale/Sw.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function mustSeparate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function mustSeparate($chunks)
          {
              $found = null;
      
              foreach ($chunks as $chunk) {
      Severity: Minor
      Found in src/Legacy/Numbers/Words/Locale/Pt/Br.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function inflectNounByNumber has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function inflectNounByNumber($number, $singular, $plural, $genitivePlural)
          {
              $units = $number % 10;
              $tens = ((int) ($number / 10)) % 10;
      
      
      Severity: Minor
      Found in src/Language/Arabic/ArabicNounGenderInflector.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function getSubHundred has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function getSubHundred($tens, $units): string
          {
              $words = [];
      
              if ($tens === 1) {
      Severity: Minor
      Found in src/Language/Kurdish/KurdishTripletTransformer.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function transformToWords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function transformToWords(int $number): string
          {
              $units = $number % 10;
              $tens = (int) ($number / 10) % 10;
              $hundreds = (int) ($number / 100) % 10;
      Severity: Minor
      Found in src/Language/Slovak/SlovakTripletTransformer.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function getSubHundred has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function getSubHundred($tens, $units): string
          {
              $words = [];
      
              if ($tens === 1) {
      Severity: Minor
      Found in src/Language/Uzbek/UzbekTripletTransformer.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function getSubHundred has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function getSubHundred(int $tens, int $units): string
          {
              $words = [];
      
              if ($tens === 1) {
      Severity: Minor
      Found in src/Language/Albanian/AlbanianTripletTransformer.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function getSubHundred has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function getSubHundred($tens, $units): string
          {
              $words = [];
      
              if ($tens === 1) {
      Severity: Minor
      Found in src/Language/Azerbaijani/AzerbaijaniTripletTransformer.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function getSubHundred has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          private function getSubHundred($tens, $units): string
          {
              $words = [];
      
              if ($tens === 1) {
      Severity: Minor
      Found in src/Language/English/EnglishTripletTransformer.php - About 25 mins to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Severity
      Category
      Status
      Source
      Language