Showing 33 of 33 total issues
Avoid too many return
statements within this method. Open
return new SlimDatabase($db['dsn'], $db['user'], $db['pass'], [
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_CLASS
]);
Avoid too many return
statements within this method. Open
return $driver;
Avoid too many return
statements within this method. Open
return new Database\Migrator($container->get('db'), $directory);
Avoid too many return
statements within this method. Open
return function ($class) use ($container) {
if (!class_exists($class)) {
throw new \LogicException("Data model class {$class} not exists ");
}
Avoid too many return
statements within this method. Open
return new Uploader($settings['upload']);
Avoid too many return
statements within this method. Open
return array_merge($commands, $settings->get('commands', []));
Avoid too many return
statements within this method. Open
return $view;
Avoid too many return
statements within this method. Open
return new Logger($settings['basename'], $settings['logger'] ?: []);
Avoid too many return
statements within this method. Open
return new Mailer(
$container->get(Mailer\MailDriverInterface::class)
);
Avoid too many return
statements within this method. Open
return new FileSystem($settings->get('filesystem', []));
Function patch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function patch($pairs = null, $terms = null)
{
$self = self::newSelf();
if (!$self->table()) {
- 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 register
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function register(PimpleContainer $container)
{
/** @var Collection $settings */
$settings = $container->get('settings');
- 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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function create(array $pairs = null)
{
$self = self::newSelf($pairs);
if (!empty($self->attributes) && null === $pairs) {
- 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"