Showing 57 of 57 total issues
Method new_login
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
function new_login()
{
$action = $_SERVER['PHP_SELF'] . '?action=submitsecrets';
$callback = get_sso_callback_url();
The class Eseye has an overall complexity of 50 which is very high. The configured complexity threshold is 50. Open
class Eseye
{
/**
* The Eseye Version.
- Exclude checks
Eseye
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Eseye
{
/**
* The Eseye Version.
File index.php
has 276 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* This file is part of SeAT
*
Function invoke
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function invoke(string $method, string $uri, array $uri_data = []): EsiResponse
{
// Check the Access Requirement
if (! $this->getAccessChecker()->can(
- 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 httpRequest
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function httpRequest(
string $method, string $uri, array $headers = [], array $body = []): EsiResponse
{
// Include some basic headers to those already passed in. Everything
Method refreshToken
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function refreshToken()
{
// Make the post request for a new access_token
try {
Method invoke
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function invoke(string $method, string $uri, array $uri_data = []): EsiResponse
{
// Check the Access Requirement
if (! $this->getAccessChecker()->can(
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($instance = null)
{
if ($instance != null)
$this->memcached = $instance;
- 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 mapDataToUri
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function mapDataToUri(string $uri, array $data): string
{
// Extract fields in curly braces. If there are fields,
// replace the data with those in the URI
- 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
The class Eseye has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13. Open
class Eseye
{
/**
* The Eseye Version.
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
The class GuzzleFetcher has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13. Open
class GuzzleFetcher implements FetcherInterface
{
/**
* @var string
- Read upRead up
- Exclude checks
CouplingBetweenObjects
Since: 1.1.0
A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability
Example
class Foo {
/**
* @var \foo\bar\X
*/
private $x = null;
/**
* @var \foo\bar\Y
*/
private $y = null;
/**
* @var \foo\bar\Z
*/
private $z = null;
public function setFoo(\Foo $foo) {}
public function setBar(\Bar $bar) {}
public function setBaz(\Baz $baz) {}
/**
* @return \SplObjectStorage
* @throws \OutOfRangeException
* @throws \InvalidArgumentException
* @throws \ErrorException
*/
public function process(\Iterator $it) {}
// ...
}
Source https://phpmd.org/rules/design.html#couplingbetweenobjects
Missing class import via use statement (line '77', column '40'). Open
$this->memcached = new \Memcached();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Remove error control operator '@' on line 75. Open
public function checkCacheDirectory()
{
// Ensure the cache path exists
if (! is_dir($this->cache_path) &&
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '79', column '40'). Open
$this->memcached = new \Memcache();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Remove error control operator '@' on line 116. Open
public function set(string $uri, string $query, EsiResponse $data)
{
$path = $this->buildRelativePath($this->safePath($uri), $query);
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
The method __construct has a boolean flag argument $protected_header, which is a certain sign of a Single Responsibility Principle violation. Open
public function __construct(array $supported_types, bool $protected_header = true)
- Read upRead up
- Exclude checks
BooleanArgumentFlag
Since: 1.4.0
A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.
Example
class Foo {
public function bar($flag = true) {
}
}
Source https://phpmd.org/rules/cleancode.html#booleanargumentflag
Missing class import via use statement (line '37', column '20'). Open
return new \Carbon\Carbon;
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Remove error control operator '@' on line 202. Open
public function forget(string $uri, string $query = '')
{
$path = $this->buildRelativePath($uri, $query);
$cache_file_path = $path . $this->results_filename;
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
Missing class import via use statement (line '35', column '24'). Open
return new \Carbon\Carbon($data);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}