Showing 332 of 2,142 total issues
Method remove
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function remove($helper, $input, $output)
{
$report = new ReportManager;
$instances = $report->getReportInstances();
$instancesInfo = CommandHelper::getInstancesInfo($instances);
Method interact
has 28 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 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('<comment>WARNING!</comment>');
$output->writeln('<comment>You are about to delete all state, backup, cache, and log files!</comment>');
Method renderInstancesTable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function renderInstancesTable($output, $rows, bool $all_infos = false)
{
if (empty($rows)) {
return false;
}
Method interact
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
if (empty($input->getOption('instances'))) {
$instances = CommandHelper::getInstances('tiki');
$instancesInfo = CommandHelper::getInstancesInfo($instances);
Method execute
has 28 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 extractTo
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function extractTo(Version $version, $folder): void
{
$dirExists = file_exists($folder);
if ($dirExists && preg_match('/tags\\//', $version->branch)) {
Method secure_trim_data
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function secure_trim_data($should_set = false)
{
$modes = ['---', '--x', '-w-', '-wx', 'r--', 'r-x', 'rw-', 'rwx'];
$stat = stat($_ENV['TRIM_DATA']);
Method runCommand
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function runCommand($command, $options = [])
{
$handle = self::getExtHandle();
$cwd = !empty($options['cwd']) ? $options['cwd'] : $this->location;
$env = !empty($options['env']) ? $options['env'] : $this->env;
Function getUpgradeVersion
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getUpgradeVersion($instance)
{
$found_incompatibilities = false;
$instance->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 promptUser
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function promptUser($prompt, $default = false, $values = [])
{
if (!$_ENV['INTERACTIVE']) {
return $default;
}
- 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 info
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function info($targetFolder, $raw = false)
{
$cmd = "info $targetFolder";
if (! $raw) {
$cmd .= ' --xml';
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$email = $input->getOption('email');
if (empty($email) || ! filter_var($email, FILTER_VALIDATE_EMAIL)) {
Method renderReportOptions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function renderReportOptions($output)
{
$headers = [
'Option',
'Description'
Method execute
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('<comment>Note: Only Tiki instances can enable reports.</comment>');
$this->io->newLine();
Method add
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function add($helper, $input, $output)
{
$report = new ReportManager;
$instances = $report->getAvailableInstances();
$instancesInfo = CommandHelper::getInstancesInfo($instances);
Method install
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function install(Instance $instance): Instance
{
$checksumCheck = $this->input->getOption('check') ?? false;
$discovery = $instance->getDiscovery();
Method interact
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('update');
$instancesInfo = CommandHelper::getInstancesInfo($instances);
Method validate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function validate($version_id, $current_checksums = [])
{
$newFiles = [];
$modifiedFiles = [];
Method localizeFolder
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function localizeFolder($remoteLocation, $localMirror)
{
if ($remoteLocation[0] != '/') {
$remoteLocation = $this->instance->getWebPath($remoteLocation);
}