Showing 332 of 2,142 total issues
Method windowsSync
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function windowsSync($remoteLocation, $localMirror, $files = [], $exclusions = [])
{
$exclude = '';
$returnVar = 0;
Method execute
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$time = $input->getOption('time');
list($hours, $minutes) = CommandHelper::validateTimeInput($time);
$arguments = '--instances=all --no-interaction';
Method interact
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
if (empty($input->getOption('time'))) {
$answer = $this->io->ask('What time should it run at?', '00:00', function ($answer) {
return CommandHelper::validateTimeInput($answer);
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$instance = new Instance();
try {
if ($input->isInteractive()) {
Method interact
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$helper = $this->getHelper('question');
$email = $input->getOption('email');
if (empty($email) || ! filter_var($email, FILTER_VALIDATE_EMAIL)) {
Method handleInstance
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleInstance(Instance $instance, InputInterface $input): Instance\CronJob
{
$this->io->section($instance->name);
$instanceOS = $instance->getDiscovery()->detectOS();
Method fixPermissions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fixPermissions($path)
{
$filesystem = new Filesystem();
$perm = $this->getFilePerm();
$user = $this->getFileUser();
Method postInstall
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postInstall(array $options = [])
{
$access = $this->instance->getBestAccess('scripting');
$access->getHost(); // trigger the config of the location change (to catch phpenv)
Method cleanup
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function cleanup($instanceId, $instanceName, $maxBackups = 0)
{
$backup_directory = "{$instanceId}-{$instanceName}";
$files = glob($_ENV['ARCHIVE_FOLDER'] . "/$backup_directory" . '/*.tar.bz2');
Method fixPermissions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fixPermissions()
{
$instance = $this->instance;
$access = $instance->getBestAccess('scripting');
Method getDetails
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getDetails($instance)
{
$archives = $instance->getArchives();
if (count($archives) > 0) {
Function execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('tiki');
$instancesInfo = CommandHelper::getInstancesInfo($instances);
$package = $input->getOption('package');
- 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 getInterpreterPath
has a Cognitive Complexity of 12 (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 readSystemIniConfigFileFromManifest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function readSystemIniConfigFileFromManifest($manifest_file)
{
$result = [];
$access = $this->getAccess();
$manifest = $access->fileGetContents($manifest_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
Function fixPermissions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function fixPermissions($path)
{
$filesystem = new Filesystem();
$perm = $this->getFilePerm();
$user = $this->getFileUser();
- 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 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances();
$instancesInfo = CommandHelper::getInstancesInfo($instances);
if (isset($instancesInfo)) {
Method execute
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$updater = UpdateManager::getUpdater();
$updater->setLogger($this->logger);
Method configure
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
Method configure
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
$this
->setName('instance:checkout')
->setDescription('Checkout a different branch or revision on an underlying Git controlled source.')
Method interact
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('tiki');
if (empty($input->getOption('patch'))) {