Showing 332 of 2,142 total issues
Function execute
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$email = $input->getOption('email');
if (empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
- 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 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
File functions.php
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
define('DS', DIRECTORY_SEPARATOR);
require_once dirname(__DIR__) . '/Requirements/Requirements.php';
Function readManifest
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
public function readManifest($manifestPath)
{
$differentInstance = $this->instance->getId() != $this->getSourceInstance()->getId();
$skipPathCheck = ($this->allowCommonParents < 0) || (count(explode('/', $this->instance->webroot)) < $this->allowCommonParents);
- 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 execute
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('update');
$instancesInfo = CommandHelper::getInstancesInfo($instances);
$enableMaintenance = empty($input->getOption('no-maintenance'));
Function execute
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$maxBackups = $input->getOption('max-backups') ?: Environment::get('DEFAULT_MAX_BACKUPS', 0);
if (isset($maxBackups) && filter_var($maxBackups, FILTER_VALIDATE_INT) === false) {
$this->io->error('Max number of backups to keep by instance is not a number');
- 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 restoreFolder
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function restoreFolder($src, $target, $isFull = false)
{
$access = $this->getAccess();
$instance = $this->instance;
$src = rtrim($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
File Environment.php
has 385 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.
* @licence Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See LICENSE for details.
Function detectWebrootOS
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
protected function detectWebrootOS()
{
$user = $this->detectUser();
$domain = parse_url($this->instance->weburl)['host'];
- 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 restoreFolder
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function restoreFolder($src, $target, $isFull = false)
{
$access = $this->getAccess();
$instance = $this->instance;
$src = rtrim($src, '/\\');
Method setupInstance
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setupInstance(Instance $instance, $import = false) : Instance
{
$url = $this->input->getOption('url') ?: $instance->getDiscovery()->detectWeburl();
$url = $this->io->ask('WebUrl', $url, function ($value) {
if (empty($value)) {
Function restoreFilesFromFolder
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
protected function restoreFilesFromFolder(string $srcFolder)
{
$manifest = "{$srcFolder}/manifest.txt";
$folders = $this->readManifest($manifest);
- 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 Local.php
has 361 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.
Method execute
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
// select time handle
$time = $input->getOption('time');
CommandHelper::validateCrontabInput($time);
Git
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class Git extends VersionControlSystem
{
protected const DEFAULT_GIT_REPOSITORY = 'https://gitlab.com/tikiwiki/tiki.git';
protected $isDefultRepository = false;
Method configure
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
Function runSetup
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
private function runSetup()
{
debug('Running Tiki Manager at ' . $_ENV['TRIM_ROOT']);
$writableFolders = ['CACHE_FOLDER', 'TEMP_FOLDER', 'RSYNC_FOLDER', 'MOUNT_FOLDER', 'BACKUP_FOLDER', 'ARCHIVE_FOLDER', 'TRIM_LOGS', 'TRIM_DATA', 'TRIM_SRC_FOLDER'];
- 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 execute
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$currentCwd = getcwd();
$instancesOpt = $input->getOption('instances');
$excludesOpt = $input->getOption('exclude');
File SSH.php
has 338 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.
Function execute
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
// select time handle
$time = $input->getOption('time');
CommandHelper::validateCrontabInput($time);
- 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"