Showing 7 of 7 total issues
Function processPackageData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function processPackageData(PackageInterface $package, $nodeType, $includeDev)
{
$rootPackage = $package->getName();
$rootVertex = $this->getVertex($rootPackage, $nodeType);
- 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 processPackageData
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processPackageData(PackageInterface $package, $nodeType, $includeDev)
{
$rootPackage = $package->getName();
$rootVertex = $this->getVertex($rootPackage, $nodeType);
Function getVertex
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getVertex($name, $nodeType)
{
if (!isset($this->vertices[$name])) {
$vertex = $this->graph->createVertex($name);
$packageType = $this->packageType($name);
- 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 getVertex
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getVertex($name, $nodeType)
{
if (!isset($this->vertices[$name])) {
$vertex = $this->graph->createVertex($name);
$packageType = $this->packageType($name);
Method execute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$noDev = $input->getOption('no-dev');
$noPlatform = $input->getOption('no-platform');
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Composer $composer, $noDev, $noExt, $noPHP, $noVertexVersions, $noEdgeVersions)
Function build
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function build()
{
if ($this->graph) {
return $this->graph;
}
- 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"