kwn/number-to-words

View on GitHub

Showing 133 of 211 total issues

Function toWords has a Cognitive Complexity of 91 (exceeds 5 allowed). Consider refactoring.
Open

    protected function toWords($number, $power = 0)
    {
        $ret = '';

        if ($number < 0) {
Severity: Minor
Found in src/Legacy/Numbers/Words/Locale/It.php - About 1 day 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 toWords has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

    protected function toWords($num, $power = 0, $powsuffix = '')
    {
        $ret = '';
        $hasPower = false;;

Severity: Minor
Found in src/Legacy/Numbers/Words/Locale/Nl.php - About 1 day 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 toWords has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
Open

    protected function toWords($number, $power = 0)
    {
        $ret = '';

        if ($number === 0) {
Severity: Minor
Found in src/Legacy/Numbers/Words/Locale/Es.php - About 1 day 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 toWords has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
Open

    protected function toWords($number, $power = 0, $powsuffix = '')
    {
        $return = '';

        // add a minus sign
Severity: Minor
Found in src/Legacy/Numbers/Words/Locale/Lt.php - About 1 day 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 toWords has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
Open

    protected function toWords($number, $power = 0)
    {
        $return = '';

        if ($number < 0) {
Severity: Minor
Found in src/Legacy/Numbers/Words/Locale/Dk.php - About 1 day 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

Method toWords has 218 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function toWords($number, $power = 0)
    {
        $ret = '';

        if ($number < 0) {
Severity: Major
Found in src/Legacy/Numbers/Words/Locale/It.php - About 1 day to fix

    Function toWords has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function toWords($number, $power = 0)
        {
            $ret = '';
    
            if ($number < 0) {
    Severity: Minor
    Found in src/Legacy/Numbers/Words/Locale/Cs.php - About 1 day 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 toWords has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function toWords($num, $power = 0, $powsuffix = '')
        {
            $ret = '';
    
            // add a minus sign
    Severity: Minor
    Found in src/Legacy/Numbers/Words/Locale/Sv.php - About 7 hrs 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 toWords has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function toWords($number, $power = 0)
        {
            $return = '';
    
            if ($number < 0) {
    Severity: Minor
    Found in src/Legacy/Numbers/Words/Locale/Id.php - About 6 hrs 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 toWords has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function toWords($number, $power = 0)
        {
            $return = '';
    
            if ($number < 0) {
    Severity: Minor
    Found in src/Legacy/Numbers/Words/Locale/Ms.php - About 6 hrs 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 toWords has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function toWords($num, $power = 0, $powsuffix = '')
        {
            $ret = '';
    
            if (substr($num, 0, 1) == '-') {
    Severity: Minor
    Found in src/Legacy/Numbers/Words/Locale/Et.php - About 6 hrs 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 toWords has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function toWords($number, $power = 0)
        {
            $return = '';
    
            if ($number < 0) {
    Severity: Minor
    Found in src/Legacy/Numbers/Words/Locale/Hu.php - About 6 hrs 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 showDigitsGroup has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        private function showDigitsGroup($num, $last = false)
        {
            $return = '';
    
            $ones = $num % 10;
    Severity: Minor
    Found in src/Legacy/Numbers/Words/Locale/Fr.php - About 6 hrs 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

    Method toWords has 146 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function toWords($number, $power = 0)
        {
            $ret = '';
    
            if ($number === 0) {
    Severity: Major
    Found in src/Legacy/Numbers/Words/Locale/Es.php - About 5 hrs to fix

      Method toWords has 134 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function toWords($number, $power = 0, $powsuffix = '')
          {
              $return = '';
      
              // add a minus sign
      Severity: Major
      Found in src/Legacy/Numbers/Words/Locale/Lt.php - About 5 hrs to fix

        Method toWords has 130 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function toWords($num, $power = 0, $powsuffix = '')
            {
                $ret = '';
                $hasPower = false;;
        
        
        Severity: Major
        Found in src/Legacy/Numbers/Words/Locale/Nl.php - About 5 hrs to fix

          Method toWords has 127 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function toWords($number, $power = 0)
              {
                  $return = '';
          
                  if ($number < 0) {
          Severity: Major
          Found in src/Legacy/Numbers/Words/Locale/Dk.php - About 5 hrs to fix

            File Ru.php has 368 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace NumberToWords\Legacy\Numbers\Words\Locale;
            
            use NumberToWords\Exception\NumberToWordsException;
            Severity: Minor
            Found in src/Legacy/Numbers/Words/Locale/Ru.php - About 4 hrs to fix

              Method toWords has 119 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function toWords($number, $power = 0)
                  {
                      $ret = '';
              
                      if ($number < 0) {
              Severity: Major
              Found in src/Legacy/Numbers/Words/Locale/Cs.php - About 4 hrs to fix

                Method toWords has 117 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function toWords($num, $power = 0, $powsuffix = '')
                    {
                        $ret = '';
                
                        // add a minus sign
                Severity: Major
                Found in src/Legacy/Numbers/Words/Locale/Sv.php - About 4 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language