Showing 21 of 106 total issues
Function parse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function parse(string $report)
{
$lines = explode($this->line_delimiter, $report);
foreach ($lines as $line)
- 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 boot
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function boot()
{
// If we are in debug mode, listen to database events
// and log queries to the log file.
- 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 getPackageLatestVersion
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function getPackageLatestVersion(string $vendor, string $package): string
{
// construct the packagist uri to its API
$packagist_url = sprintf('https://packagist.org/packages/%s/%s.json',
$vendor, $package);
- 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 validate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function validate()
{
if ($this->isEmpty())
throw new EmptyReportException();
- 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 evemail_threads
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function evemail_threads($message)
{
// Explode the messages based on the delimiter added
// by the EVE Online Client.
Method __construct
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(string $type, string $variation, ?int $id, int $size, array $attr = [], bool $lazy = true)
{
// Validate the arguments
if (! in_array($type, $this->known_types))
throw new EveImageException($type . ' is not a valid image type.');
Consider simplifying this complex logical expression. Open
if ($id > 90000000 && $id < 98000000)
return 'characters';
elseif (($id > 98000000 && $id < 99000000) || ($id > 1000000 && $id < 2000000))
return 'corporations';
Function __construct
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(string $type, string $variation, ?int $id, int $size, array $attr = [], bool $lazy = true)
{
// Validate the arguments
if (! in_array($type, $this->known_types))
throw new EveImageException($type . ' is not a valid image type.');
- 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 number_roman
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function number_roman($number)
{
$map = [
'M' => 1000, 'CM' => 900, 'D' => 500, 'CD' => 400, 'C' => 100, 'XC' => 90, 'L' => 50,
- 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 setting
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function setting($name, bool $global = false)
{
// If we received an array, it means we want to set.
if (is_array($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 getPackageLatestVersion
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getPackageLatestVersion(string $vendor, string $package): string
{
// construct the packagist uri to its API
$packagist_url = sprintf('https://packagist.org/packages/%s/%s.json',
$vendor, $package);
Method parse
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse(string $report)
{
$lines = explode($this->line_delimiter, $report);
foreach ($lines as $line)
Function html
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function html()
{
// make new IMG tag
$html = '<img ';
- 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 detect_type
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function detect_type($id)
{
if ($id === null)
return 'unknown';
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $type, string $variation, ?int $id, int $size, array $attr = [], bool $lazy = true)
Function __get
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __get($key)
{
// fetch injected relations
$extension_registry = app()->make(InjectedRelationRegistry::class);
$extension_class = $extension_registry->getExtensionClassFor($this::class, $key);
- 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 img
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function img(string $type, string $variation, ?int $id, int $size, array $attr = [], $lazy = true)
Function getPluginsMetadataList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getPluginsMetadataList(): stdClass
{
app()->loadDeferredProviders();
$providers = array_keys(app()->getLoadedProviders());
- 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 $installed_version;
Avoid too many return
statements within this method. Open
return 'characters';