Showing 10 of 10 total issues
Function toXml
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function toXml(
\DomDocument $xml_document,
string $name
) : array {
$xml_file = $xml_document->createElement('file');
- 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 toXml
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toXml(
\DomDocument $xml_document,
string $name
) : array {
$xml_file = $xml_document->createElement('file');
Method toXml
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function toXml() : array
{
// Sort files by name
$this->files->ksort();
Method execute
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() : bool
{
$accumulator = new Accumulator($this->merge_mode);
// Parse
Method __construct
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(array $argv)
{
$cli = Cli::create()
->opt('output:o', 'output file path', true)
->opt('mode:m', 'merge mode: additive, exclusive or inclusive (default)', false)
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
int $statement_count = 0,
int $covered_statement_count = 0,
int $conditional_count = 0,
int $covered_conditional_count = 0,
int $method_count = 0,
Function parseChildXML
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function parseChildXML(File &$file, \SimpleXMLElement $child)
{
$name = $child->getName();
$attributes = $child->attributes();
if ($name === 'class') {
- 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 execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function execute() : bool
{
$accumulator = new Accumulator($this->merge_mode);
// Parse
- 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 toXml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function toXml() : array
{
// Sort files by name
$this->files->ksort();
- 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 parseItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function parseItem(
\SimpleXMLElement $element,
?string $package_name = null
) : void {
$name = $element->getName();
- 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"