sandfoxme/composer-viz

View on GitHub

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);
Severity: Minor
Found in src/Engine/GraphBuilder.php - About 1 hr 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 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);
Severity: Minor
Found in src/Engine/GraphBuilder.php - About 1 hr to fix

    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);
    Severity: Minor
    Found in src/Engine/GraphBuilder.php - About 1 hr 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 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);
    Severity: Minor
    Found in src/Engine/GraphBuilder.php - About 1 hr to fix

      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');
      Severity: Minor
      Found in src/VizCommand.php - About 1 hr to fix

        Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function __construct(Composer $composer, $noDev, $noExt, $noPHP, $noVertexVersions, $noEdgeVersions)
        Severity: Minor
        Found in src/Engine/GraphBuilder.php - About 45 mins to fix

          Function build has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              public function build()
              {
                  if ($this->graph) {
                      return $this->graph;
                  }
          Severity: Minor
          Found in src/Engine/GraphBuilder.php - About 25 mins 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

          Severity
          Category
          Status
          Source
          Language