Showing 17 of 17 total issues
PluginInformation
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class PluginInformation
{
const DEFAULT_ICON = 'icon_64.png';
/** @var int */
Logger
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Logger
{
const LOGLEVEL_FATAL_ERROR = 0;
const LOGLEVEL_ALERT = 1;
const LOGLEVEL_CRITICAL_ERROR = 2;
MiniserverInformation
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class MiniserverInformation
{
/** @var string */
private $name;
Function parseTranslations
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function parseTranslations()
{
if (!file_exists($this->fileName) || !is_readable($this->fileName)) {
throw new \InvalidArgumentException(sprintf('Non existing translation file %s requested.', $this->fileName));
}
- 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 sendToSocket
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function sendToSocket($socket, string $buf, int $len, int $flags, string $addr, int $port = 0)
Method __invoke
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $logName,
string $packageName,
?string $fileName = null,
bool $writeToFile = true,
bool $writeToStdErr = false,
Method create
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $logName,
string $packageName,
?string $fileName = null,
bool $writeToFile = true,
bool $writeToStdErr = false,
Method fileGetContents
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function fileGetContents($filename, bool $use_include_path = false, $context = null, int $offset = 0, ?int $maxlen = null)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
LogFileDatabaseFactory $databaseFactory,
LowLevelExecutor $lowLevelExecutor,
PathProvider $pathProvider,
SystemConfigurationParser $systemConfiguration,
PluginDatabase $pluginDatabase
Method notify
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $packageName,
string $name,
string $message,
array $additionalData = [],
$isError = false
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
string $logName,
string $packageName,
EventLogger $eventLogger,
AttributeLogger $attributeLogger,
SystemConfigurationParser $systemConfiguration
Function log
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function log($messageOrEvent, int $level = self::LOGLEVEL_DEBUG)
{
if (!$this->started) {
$this->logStart();
}
- 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 getStorageDeviceSelect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getStorageDeviceSelect(string $formId, array $flagsAndConfigurations = []): string
{
foreach ($flagsAndConfigurations as $configurationOrKey => $flagOrValue) {
if (is_numeric($configurationOrKey)) {
if (!in_array($flagOrValue, self::KNOWN_FLAGS)) {
- 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 push
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function push(MiniserverInformation $miniserver, array $data, ?string $prefix = null)
{
if (null === $this->udpPort) {
throw new \LogicException('Cannot execute UDP call, port must be set first via setUdpPort');
}
- 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 $now->format('"Y-m-d\TH:i:sO"');
Avoid too many return
statements within this method. Open
return $now->format('Ymd_His_').$microseconds;
Function prepareMessages
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function prepareMessages(array $data, ?string $prefix = null): array
{
$messages = [];
$prefixStrLength = null !== $prefix ? strlen($prefix) + 2 : 0;
$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"