Showing 332 of 2,142 total issues
Method create
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create($skipArchive = false, $backupDir = null)
{
$backupDir = $backupDir ?: $this->backupDir;
$this->io->writeln('Checking directories...');
Method decompressArchive
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function decompressArchive($folder, $archive)
{
$access = $this->access;
$bzipStep = false;
Method readSystemIniConfigFileFromManifest
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readSystemIniConfigFileFromManifest($manifest_file)
{
$result = [];
$access = $this->getAccess();
$manifest = $access->fileGetContents($manifest_file);
Method createArchive
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createArchive($archiveDir = null)
{
$archiveDir = $archiveDir ?: $this->archiveDir;
$nice = 'nice -n 19';
Method detectPHPLinux
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function detectPHPLinux($options = [], $searchOrder = null)
{
if ($searchOrder === null) {
$searchOrder = [
['command', ['-v', 'php']],
Method info
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function info($targetFolder, $raw = false)
{
$cmd = "info $targetFolder";
if (! $raw) {
$cmd .= ' --xml';
Method info
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function info($path, $args = [])
{
if (empty($args)) {
$args = $this->getDefaultArgs('info');
}
Method detectPHPMacOS
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function detectPHPMacOS($options = [], $searchOrder = null)
{
if ($searchOrder === null) {
$searchOrder = [
['command', ['-v', 'php']],
Method update
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update(string $targetFolder, string $branch, int $lag = 0)
{
$info = $this->info($targetFolder);
$root = $info['repository']['root'];
$url = $info['url'];
Method execute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('tiki');
$instancesInfo = CommandHelper::getInstancesInfo($instances);
Method getUpgradeVersion
has 32 lines of code (exceeds 25 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);
Method rsync
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function rsync($args = [])
{
$return_val = -1;
if (empty($args['src']) || empty($args['dest'])) {
Method getAvailableBranches
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAvailableBranches()
{
$versions = [];
foreach (explode("\n", `git ls-remote --heads --tags --refs $this->repositoryUrl`) as $line) {
Method getAvailableBranches
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAvailableBranches()
{
$versions = [];
$versionsTemp = [];
Function getInterpreterPath
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getInterpreterPath(TikiRequirements $requirements = null)
{
$instance = $this->instance;
$detectedBinaries = $instance->phpexec ? [$instance->phpexec] : $instance->getDiscovery()->detectPHP();
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances();
$instancesInfo = CommandHelper::getInstancesInfo($instances);
if (isset($instancesInfo)) {
- 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 getHost
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getHost()
{
$host = new SSHHost($this->host, $this->user, $this->port);
// change cwd before executing commands, for instance in CoreOS it may influence what
- 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 loadEnvironmentVariablesContainingLogic
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function loadEnvironmentVariablesContainingLogic()
{
$_ENV['TRIM_OS'] = strtoupper(substr(PHP_OS, 0, 3));
if ($_ENV['TRIM_OS'] === 'WIN') {
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function create($skipArchive = false, $backupDir = null)
{
$backupDir = $backupDir ?: $this->backupDir;
$this->io->writeln('Checking directories...');
- 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 restore
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
public function restore($srcInstance, $archive, $clone = false, $checksumCheck = false, $direct = false, $onlyData = false, $onlyCode = false, $options = [], $skipSystemConfigurationCheck = false, $allowCommonParents = 0)