FriendsOfPHP/pickle

View on GitHub
src/Package/PHP/Command/Release/Windows/Binary.php

Summary

Maintainability
C
7 hrs
Test Coverage

Function create has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public function create(array $args = [])
    {
        if (!isset($args['build']) || !($args['build'] instanceof Interfaces\Package\Build)) {
            throw new Exception('Invalid or NULL object passed as Interfaces\\Package\\Build');
        }
Severity: Minor
Found in src/Package/PHP/Command/Release/Windows/Binary.php - About 3 hrs 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 create has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function create(array $args = [])
    {
        if (!isset($args['build']) || !($args['build'] instanceof Interfaces\Package\Build)) {
            throw new Exception('Invalid or NULL object passed as Interfaces\\Package\\Build');
        }
Severity: Major
Found in src/Package/PHP/Command/Release/Windows/Binary.php - About 2 hrs to fix

    Function composerJsonBak has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function composerJsonBak(Interfaces\Package $pkg, $restore = false)
        {
            $composer_json_orig = $pkg->getRootDir() . DIRECTORY_SEPARATOR . 'composer.json';
            $composer_json_bak = $pkg->getRootDir() . DIRECTORY_SEPARATOR . '.composer.json.orig';
    
    
    Severity: Minor
    Found in src/Package/PHP/Command/Release/Windows/Binary.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

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

        public function getMultiExtensionNames()
        {
            $info = $this->build->getInfo();
            $ext_names = [$info['name']];
    
    
    Severity: Minor
    Found in src/Package/PHP/Command/Release/Windows/Binary.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

    There are no issues that match your filters.

    Category
    Status