Showing 143 of 189 total issues
Function execute
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(Input $input, Output $output): int
{
$this->deployer->input = $input;
$this->deployer->output = $output;
$this->deployer['log'] = $input->getOption('log');
- 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 parse
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse(string $source): void
{
$comment = '';
$params = '';
Method configure
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure()
{
parent::configure();
// Add global options defined with `option()` func.
Function selectHosts
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function selectHosts(Input $input, Output $output): array
{
$output->getFormatter()->setStyle('success', new OutputFormatterStyle('green'));
if (!$output->isDecorated() && !defined('NO_ANSI')) {
define('NO_ANSI', 'true');
- 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 execute
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(Input $input, Output $output): int
{
$this->deployer->input = $input;
$this->deployer->output = new NullOutput();
$hosts = $this->selectHosts($input, $output);
- 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 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$this->telemetry();
$hostname = $input->getArgument('hostname');
if (!empty($hostname)) {
Method compareIdentifiers
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function compareIdentifiers(array $left, array $right)
{
if ($left && empty($right)) {
return self::LESS_THAN;
} elseif (empty($left) && $right) {
Method run
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run(Host $host, string $command, array $config = []): string
{
$defaults = [
'timeout' => $host->get('default_timeout', 300),
'idle_timeout' => null,
Method selectHosts
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function selectHosts(Input $input, Output $output): array
{
$output->getFormatter()->setStyle('success', new OutputFormatterStyle('green'));
if (!$output->isDecorated() && !defined('NO_ANSI')) {
define('NO_ANSI', 'true');
Method getGitCommitsRefs
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getGitCommitsRefs(): Closure
{
return static function ($config = []): array {
$previousReleaseRevision = getPreviousReleaseRevision();
$currentReleaseRevision = getCurrentReleaseRevision() ?: 'HEAD';
Method createTreeFromTaskName
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createTreeFromTaskName(string $taskName, string $postfix = '', bool $isLast = false)
{
$task = $this->deployer->tasks->get($taskName);
if (!$task->isEnabled()) {
Method execute
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(Input $input, Output $output): int
{
$this->deployer->input = $input;
$this->deployer->output = new NullOutput();
$hosts = $this->selectHosts($input, $output);
Method printWhiskey
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function printWhiskey(int $whiskeyLevel)
{
if ($whiskeyLevel == 4) {
echo <<<ASCII
Function findRecent
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function findRecent(Version $version, bool $major = false, bool $pre = false): ?Update
{
/** @var Update|null */
$current = null;
$major = $major ? $version->getMajor() : 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 task
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function task(string $name, $body = null): Task
{
$deployer = Deployer::get();
if (empty($body)) {
- 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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
if (getenv('COLORTERM') === 'truecolor') {
$output->write(
<<<EOF
- 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 get
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function get(string $name, mixed $default = null): mixed
{
if (array_key_exists($name, $this->values)) {
if (is_closure($this->values[$name])) {
return $this->values[$name] = $this->parse(call_user_func($this->values[$name]));
- 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 run
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function run(string $version, ?string $deployFile): void
{
if (str_contains($version, 'master')) {
// Get version from composer.lock
$lockFile = __DIR__ . '/../../../../composer.lock';
Method send
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function send(?array &$info = null): string
{
if ($this->url === '') {
throw new \RuntimeException('URL must not be empty to Httpie::send()');
}
Method collect
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function collect(InputInterface $input, OutputInterface $output): array
{
$arguments = [];
foreach ($input->getOptions() as $name => $value) {
if (!$input->getOption($name)) {