Showing 332 of 2,142 total issues
Function performUpdate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function performUpdate(Instance $instance, $version = null, $options = [])
{
$current = $instance->getLatestVersion();
if (is_null($version)) {
- 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 update
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function update(string $targetFolder, string $branch, int $lag = 0)
{
$commitSHA = null;
$fetchOptions = [];
$time = time() - $lag * 60 * 60 * 24;
- 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 rsync
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function rsync($args = [])
{
$return_val = -1;
if (empty($args['src']) || empty($args['dest'])) {
return $return_val;
- 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 getBranchToUpdate
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getBranchToUpdate($branch)
{
if (preg_match('/(\d+)\.(\d+).*/', $branch, $matches1)) {
$major = $matches1[1];
$toUpdate = $matches1[0];
- 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 mergeWithExistingEnvironmentVariables
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function mergeWithExistingEnvironmentVariables($newEnvironmentVariables)
{
$env = [];
// getenv will only return all env variables starting 7.1.0
- 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 validateInstanceSelection
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function validateInstanceSelection($answer, $instances)
{
if (empty($answer)) {
throw new \RuntimeException(
'You must select an instance #ID'
Method getInterpreterPath
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInterpreterPath(TikiRequirements $requirements = null)
{
$instance = $this->instance;
$detectedBinaries = $instance->phpexec ? [$instance->phpexec] : $instance->getDiscovery()->detectPHP();
Method updateInstanceTo
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateInstanceTo($path, $branch)
{
$info = $this->info($path);
$root = $info['repository']['root'];
$url = $info['url'];
Method installNodeJsDependencies
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function installNodeJsDependencies()
{
if (! $this->supportsNodeJSBuild()) {
return;
}
Method configure
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
Method configure
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
Method getInterpreterPath
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInterpreterPath(TikiRequirements $requirements = null)
{
$instance = $this->instance;
$detectedBinaries = $instance->phpexec ? [$instance->phpexec] : $instance->getDiscovery()->detectPHP();
Method php
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function php()
{
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
$paths = `where php`;
Method installComposerDependencies
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function installComposerDependencies()
{
$this->io->writeln('Installing composer dependencies... <fg=yellow>[may take a while]</>');
$instance = $this->instance;
Method runCommands
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function runCommands($commands, $output = false)
{
if (!is_array($commands)) {
$commands = func_get_args();
}
Method exec
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exec($targetFolder, $toAppend)
{
static $tmpFolderChecked;
if ((empty($tmpFolderChecked) || !in_array(
$targetFolder,
Method checkSshKey
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkSshKey()
{
$params = [
'-i',
$_ENV['SSH_KEY'],
Method interact
has 29 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 modify
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function modify($helper, $input, $output)
{
$report = new ReportManager;
$instances = $report->getReportInstances();
$instancesInfo = CommandHelper::getInstancesInfo($instances);
Method createUnpronounceable
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function createUnpronounceable($length, $chars)
{
global $_Text_Password_NumberOfPossibleCharacters;
$password = '';