Showing 332 of 2,142 total issues
Function getPassword
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function getPassword($stars = false)
{
// Get current style
$oldStyle = shell_exec('stty -g');
- 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 interact
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$this->io->note('Backups are only available on Local and SSH instances.');
$instances = CommandHelper::getInstances('all', true);
Method configure
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
Method getInstancesInfo
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getInstancesInfo(array $instances, bool $all_infos = false): ?array
{
$instancesInfo = null;
foreach ($instances as $instance) {
Method configure
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
Method interact
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('all', true);
$instancesInfo = CommandHelper::getInstancesInfo($instances);
Method restoreDatabase
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function restoreDatabase(Database $database, string $remoteFile, bool $clone)
{
$tmp = tempnam($_ENV['TEMP_FOLDER'], 'dblocal');
if (! empty($database->dbLocalContent)) {
Method getSVNPath
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSVNPath()
{
$host = $this->getHost();
$sets = [
Function execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$checksumCheck = $input->getOption('check') ?? false;
$instancesOption = $input->getOption('instances');
$instances = CommandHelper::getInstances('update');
- 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 setupDatabase
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function setupDatabase(Instance $instance, $reconfigure = false): Instance
{
try {
if (!$reconfigure && $this->testExistingDbConnection($instance)) {
return $instance;
- 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 detectPHPMacOS
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function detectPHPMacOS($options = [], $searchOrder = null)
{
if ($searchOrder === null) {
$searchOrder = [
['command', ['-v', 'php']],
- 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 restoreDatabase
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function restoreDatabase(Database $database, string $remoteFile, bool $clone)
{
$tmp = tempnam($_ENV['TEMP_FOLDER'], 'dblocal');
if (! empty($database->dbLocalContent)) {
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
public function info($path, $args = [])
{
if (empty($args)) {
$args = $this->getDefaultArgs('info');
}
- 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 postInstall
has a Cognitive Complexity of 13 (exceeds 5 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)
- 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 detectPHPLinux
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function detectPHPLinux($options = [], $searchOrder = null)
{
if ($searchOrder === null) {
$searchOrder = [
['command', ['-v', 'php']],
- 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 setSafeDirectory
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function setSafeDirectory($instance)
{
$skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;
if ($skipSafeDir) {
- 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 install
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function install(Version $version, $checksumCheck = false)
{
$access = $this->instance->getBestAccess('scripting');
$host = $access->getHost();
Method setSafeDirectory
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function setSafeDirectory($instance)
{
$skipSafeDir = isset($_ENV['GIT_DONT_ADD_SAFEDIR']) ? (bool) $_ENV['GIT_DONT_ADD_SAFEDIR'] : false;
if ($skipSafeDir) {
Method interact
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function interact(InputInterface $input, OutputInterface $output)
{
$instances = CommandHelper::getInstances('tiki');
$instancesInfo = CommandHelper::getInstancesInfo($instances);
Method setupRemoteAccess
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function setupRemoteAccess(Access $access)
{
$host = $this->io->ask('Host', $this->input->getOption('host') ?? '', function ($value) {
return !empty($value) ? $value : new InvalidOptionException("You must provide a valid remote host. Please use --host=<HOST>");
});