Function execute
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
if (!$this->debug) {
- 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 runBlockingServer
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function runBlockingServer(SymfonyStyle $io, InputInterface $input, OutputInterface $output): int
{
$callback = null;
$disableOutput = false;
- 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
File ServerCommand.php
has 281 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php declare(strict_types=1);
/*
* This file is part of Biurad opensource projects.
*
Method execute
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$io = new SymfonyStyle($input, $output instanceof ConsoleOutputInterface ? $output->getErrorOutput() : $output);
if (!$this->debug) {
Method runBlockingServer
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function runBlockingServer(SymfonyStyle $io, InputInterface $input, OutputInterface $output): int
{
$callback = null;
$disableOutput = false;
Method configure
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function configure(): void
{
$this
->setDefinition([
new InputArgument('addressport', InputArgument::OPTIONAL, 'The address to listen to (can be address:port, address, or port)'),
Function start
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function start(string $pidFile)
{
$pid = pcntl_fork();
if ($pid < 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
Avoid too many return
statements within this method. Open
return 1;
Avoid too many return
statements within this method. Open
return $this->runBlockingServer($io, $input, $output);
Avoid too many return
statements within this method. Open
return 1;
Avoid too many return
statements within this method. Open
return self::SUCCESS;
Avoid too many return
statements within this method. Open
return 1;
Function findServerAddress
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function findServerAddress(?string $address): string
{
if (null === $address) {
$this->hostname = '127.0.0.1';
$this->port = $this->findBestPort();
- 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"