Showing 332 of 2,142 total issues
Function execute
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$vcsOption = $input->getOption('vcs');
$vcsOption = $vcsOption ? strtoupper($vcsOption) : '';
if (! in_array($vcsOption, ['SVN', 'GIT', 'SRC'])) {
- 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 php
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function php()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$paths = `where php`;
- 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
File Discovery.php
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// Copyright (c) 2016, Avan.Tech, et. al.
// Copyright (c) 2008, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
File SetupCloneManagerCommand.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @copyright (c) Copyright by authors of the Tiki Manager Project. All Rights Reserved.
* See copyright.txt for details and a complete list of authors.
Method setupDatabase
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setupDatabase(Database $database)
{
$tmp = tempnam($_ENV['TEMP_FOLDER'], 'dblocal');
$dbFileContents = $this->generateDbFileContent($database);
file_put_contents($tmp, $dbFileContents);
Method getSVNPath
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSVNPath()
{
$host = $this->getHost();
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
Method update
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update(string $targetFolder, string $branch, int $lag = 0)
{
$commitSHA = null;
$fetchOptions = [];
$time = time() - $lag * 60 * 60 * 24;
Method execute
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('tiki');
$instancesInfo = CommandHelper::getInstancesInfo($instances);
$package = $input->getOption('package');
Method restoreFilesFromFolder
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function restoreFilesFromFolder(string $srcFolder)
{
$manifest = "{$srcFolder}/manifest.txt";
$folders = $this->readManifest($manifest);
Function execute
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('no-tiki');
$instancesInfo = CommandHelper::getInstancesInfo($instances);
- 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 getUpgradeVersion
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getUpgradeVersion(Instance $instance, bool $onlySupported, string $branch = null, Version $curVersion = null): ?Version
{
$curVersion = $curVersion ?: $instance->getLatestVersion();
if ($instance->getApplication()) {
$versions = $instance->getApplication()->getUpgradableVersions($curVersion, $onlySupported);
- 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 prepareArgs
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function prepareArgs($args)
{
$result = [];
if (is_string($args)) {
$args = preg_split('/ */', $args);
- 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 getAvailableBranches
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getAvailableBranches()
{
$versions = [];
$versionsTemp = [];
- 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 loadEnvironmentVariablesContainingLogic
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function loadEnvironmentVariablesContainingLogic()
{
$_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));
if ($_ENV['TRIM_OS'] === 'WIN') {
Method execute
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$this->printManagerInfo();
$this->io->title('New Instance Setup');
Method copyDirectories
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function copyDirectories($targets, $backupDir)
{
$access = $this->getAccess();
$backupDir = $backupDir ?: $this->backupDir;
$result = [];
Method rsync
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rsync($args = [])
{
$return_val = -1;
if (empty($args['src']) || empty($args['dest'])) {
return $return_val;
Function validateInstanceSelection
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public static function validateInstanceSelection($answer, $instances)
{
if (empty($answer)) {
throw new \RuntimeException(
'You must select an instance #ID'
- 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 interact
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('tiki');
$instances = array_filter($instances, function ($instance) {
return $instance->vcs_type == '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 getLocalCheckouts
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getLocalCheckouts()
{
$access = $this->instance->getBestAccess('scripting');
$access->chdir($this->instance->webroot);
$command = $access->createCommand('find', ['.', '-type', 'd', '-name', '.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"