Showing 133 of 211 total issues
Function showDigitsGroup
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function showDigitsGroup(int $num, int $gender = 0, bool $last = false): string
{
/* A storage array for the return string.
Positions 1, 3, 5 are intended for digit words
and everything else (0, 2, 4) for "and" words.
- Read upRead up
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 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function toWords($number, $power = 0)
{
$return = '';
if ($number < 0) {
Method toWords
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function toWords($number, $power = 0)
{
$return = '';
if ($number < 0) {
Method toWords
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function toWords($number, $power = 0)
{
$return = '';
if ($number < 0) {
Function showDigitsGroup
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function showDigitsGroup($number, $last = false)
{
$ret = '';
$units = $number % 10;
- Read upRead up
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 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function toWords($num, $power = 0, $powsuffix = '')
{
$ret = '';
if (substr($num, 0, 1) == '-') {
Function toWords
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
protected function toWords(int $num = 0): string
{
$ret = [];
$retMinus = '';
- Read upRead up
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 26 (exceeds 5 allowed). Consider refactoring. Open
private function showDigitsGroup($num, $gender = 0, $last = false)
{
/* A storage array for the return string.
Positions 1, 3, 5 are intended for digit words
and everything else (0, 2, 4) for "and" words.
- Read upRead up
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
File Mk.php
has 322 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace NumberToWords\Legacy\Numbers\Words\Locale;
use NumberToWords\Legacy\Numbers\Words;
Function toWords
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function toWords($num = 0)
{
$ret = [];
$ret_minus = '';
- Read upRead up
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 showDigitsGroup
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showDigitsGroup(int $num, int $gender = 0, bool $last = false): string
{
/* A storage array for the return string.
Positions 1, 3, 5 are intended for digit words
and everything else (0, 2, 4) for "and" words.
Function toCurrencyWords
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function toCurrencyWords($currency, $decimal, $fraction = null)
{
$negative = 0;
$ret = [];
$noDecimals = false;
- Read upRead up
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 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function toWords(int $num = 0): string
{
$ret = [];
$retMinus = '';
Function toCurrencyWords
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function toCurrencyWords($currency, $decimal, $fraction = null)
{
$return = '';
$currency = strtoupper($currency);
- Read upRead up
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 20 (exceeds 5 allowed). Consider refactoring. Open
private function showDigitsGroup($number, $noun, $forceNoun = false, $forcePlural = false)
{
$ret = '';
$units = $number % 10;
- Read upRead up
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
File Es.php
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace NumberToWords\Legacy\Numbers\Words\Locale;
use NumberToWords\Exception\NumberToWordsException;
File Bg.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace NumberToWords\Legacy\Numbers\Words\Locale;
use NumberToWords\Legacy\Numbers\Words;
Method toWords
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function toWords($number, $use_suffix = true, $use_spaces = true)
{
$space = $use_spaces ? ' ' : '';
if (!is_numeric($number)) {
return false;
Function getWordsBySplittingIntoTriplets
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function getWordsBySplittingIntoTriplets(int $number): array
{
$words = [];
$triplets = $this->numberToTripletsConverter->convertToTriplets($number);
- Read upRead up
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 19 (exceeds 5 allowed). Consider refactoring. Open
public function transformToWords(int $number, int $power): string
{
$units = $number % 10;
$tens = (int) ($number / 10) % 10;
$hundreds = (int) ($number / 100) % 10;
- Read upRead up
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"