Showing 7 of 7 total issues
Method addHelpParameter
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addHelpParameter()
{
$this->addParameter(
new Parameter('h', 'help', Parameter::VALUE_NO_VALUE),
'Display this help and exit.',
Function getValue
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getValue($arguments)
{
// Parse arguments
$index = -1;
foreach ($arguments as $i => $value) {
- 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 strPadAll
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function strPadAll(
$lines,
$modes = array(),
$lineSeparator = "\n",
$columnSeparator = ' ',
Function processParameters
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function processParameters($arguments)
{
// Get parameter values without throwing exceptions in case of missing
// required parameter (ex: my-sctipt -h misses -u)
$options = array();
- 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 addParameter
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function addParameter($parameter, $description, $callback = null)
{
// Check whether a parameter with the same switch already exists
foreach ($this->parameters as $p) {
- 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 strPadAll
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function strPadAll(
$lines,
$modes = array(),
$lineSeparator = "\n",
$columnSeparator = ' ',
- 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 strPadAll
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$lines,
$modes = array(),
$lineSeparator = "\n",
$columnSeparator = ' ',
$fillCharacter = ' ',