Showing 59 of 59 total issues
Function load
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function load($path, $versionOverride = null)
{
if (is_file($path) === false) {
throw new InvalidArgumentException('File not found: ' . $path);
}
- 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 24 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
if (DIRECTORY_SEPARATOR === '\\' || $input->getOption('pack-logs')) {
Factory::getZipperClassName(); // Be sure we have a way to zip files
}
- 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 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');
}
- 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 load
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function load($path, $versionOverride = null)
{
if (is_file($path) === false) {
throw new InvalidArgumentException('File not found: ' . $path);
}
Function buildOptions
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function buildOptions(Package $package, InputInterface $input, OutputInterface $output)
{
$helper = $this->getHelperSet()->get('question');
$configureOptions = $input->getOption('with-configure-options');
- 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 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');
}
Method execute
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
if (DIRECTORY_SEPARATOR === '\\' || $input->getOption('pack-logs')) {
Factory::getZipperClassName(); // Be sure we have a way to zip files
}
Method configure
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
Function copySrcDir
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function copySrcDir($src, $dest)
{
foreach (scandir($src) as $file) {
$srcfile = rtrim($src, '/') . '/' . $file;
$destfile = rtrim($dest, '/') . '/' . $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 download
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function download($url)
{
$progress = $this->progress;
$progress->setOverwrite(true);
$ctx = stream_context_create(
Function resolveForBin
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function resolveForBin($dll, $resolve_multiple_cb = null)
{
$dep_zips = $this->getZipUrlsForDll($dll, false);
if (count($dep_zips) == 1) {
- 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 getZipUrlsForDll
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function getZipUrlsForDll($binary, $ignore_installed = false)
{
$dll = $this->getDllsForBinary($binary);
$packages = [];
foreach ($this->dllMap as $pkg_name => $pkg) {
- 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 getCompilerFromPhpInfo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function getCompilerFromPhpInfo($info)
{
$compiler = '';
foreach ($info as $s) {
- 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 binaryInstallWindows
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function binaryInstallWindows($path, InputInterface $input, OutputInterface $output)
{
Factory::getUnzipperClassName(); // Be sure we have a way to unzip files
$php = Engine::factory();
$table = new Table($output);
Method buildOptions
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildOptions(Package $package, InputInterface $input, OutputInterface $output)
{
$helper = $this->getHelperSet()->get('question');
$configureOptions = $input->getOption('with-configure-options');
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';
- 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 prepare
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function prepare()
{
$matches = null;
if (Type::determinePickle($this->path, $matches) < 1) {
throw new Exception('Not a pickle git URI');
- 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 __construct
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(Interfaces\Package $package)
{
$dir = $package->getSourceDir();
$path = $package->getSourceDir() . '/.gitignore';
$this->excluded = glob("{$dir}/.git/*");
- 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 prepareConfigOpts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareConfigOpts()
{
$configureOptions = '';
foreach ($this->options as $name => $option) {
if ($option->type === 'enable') {
- 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 configure
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this
->addArgument(
'path',