Showing 143 of 189 total issues
Function import
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function import($paths)
{
if (!is_array($paths)) {
$paths = [$paths];
}
- 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 hosts
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected static function hosts(array $hosts)
{
foreach ($hosts as $alias => $config) {
if ($config['local'] ?? false) {
$host = localhost($alias);
- 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 before
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected static function before(array $before)
{
foreach ($before as $key => $value) {
if (is_array($value)) {
foreach (array_reverse($value) as $v) {
- 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 after
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected static function after(array $after)
{
foreach ($after as $key => $value) {
if (is_array($value)) {
foreach (array_reverse($value) as $v) {
- 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 runLocally
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
function runLocally(string $command, ?array $options = [], ?int $timeout = null, ?int $idle_timeout = null, ?string $secret = null, ?array $env = null, ?string $shell = null): string
Avoid deeply nested control flow statements. Open
while (!preg_match('/^}\);$/', $line)) {
$body[] = trim($line);
$line = $lines[++$i];
}
Function run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function run(): void
{
try {
$this->socket = $this->createServerSocket();
$this->updatePort();
- 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 __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(string $message = "", int $code = 0, ?Throwable $previous = null)
{
if (function_exists('debug_backtrace')) {
$trace = debug_backtrace();
foreach ($trace as $t) {
- 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 fetch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function fetch(string $url, string $method = 'get', array $headers = [], ?string $body = null, ?array &$info = null, bool $nothrow = false): string
Avoid deeply nested control flow statements. Open
while (!preg_match('/^]/', $line)) {
$multiLineArray .= $line . "\n";
$line = $lines[++$i];
}
Function outputTree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function outputTree(string $taskName)
{
$this->output->writeln("The task-tree for <info>$taskName</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 askChoice
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function askChoice(string $message, array $availableChoices, $default = null, bool $multiselect = false)
{
if (defined('DEPLOYER_NO_ASK')) {
throw new WillAskUser($message);
}
- 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 artisan
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function artisan($command, $options = [])
{
return function () use ($command, $options) {
// Ensure the artisan command is available on the current 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 run
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function run(Host $host, string $command, array $config = []): string
{
$defaults = [
'timeout' => $host->get('default_timeout', 300),
'idle_timeout' => null,
- 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 spark
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function spark($command, $options = [])
{
return function () use ($command, $options) {
// Ensure the spark command is available on the current 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
Consider simplifying this complex logical expression. Open
if (!is_array($config) ||
!isset($config['host']) ||
!isset($config['port']) ||
!isset($config['username']) ||
!isset($config['token']) ||
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Host $host,
string $command,
int $exitCode,
string $output,
string $errorOutput,
Method option
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function option(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null): void
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
int $major = 0,
int $minor = 0,
int $patch = 0,
array $pre = [],
array $build = [],
Function host
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function host(string ...$hostname)
{
$deployer = Deployer::get();
if (count($hostname) === 1 && $deployer->hosts->has($hostname[0])) {
return $deployer->hosts->get($hostname[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"