Showing 33 of 33 total issues
Method register
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function register(PimpleContainer $container)
{
/** @var Collection $settings */
$settings = $container->get('settings');
Models
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Models implements \Countable
{
const UPDATED = 'updated_at';
const CREATED = 'created_at';
const DELETED = 'deleted_at';
Function migratePhp
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function migratePhp($filepath, $action = 'up')
{
$migration = require $filepath;
$callable = null;
$schema = $this->newBlueprint();
- 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 normalizeTerms
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function normalizeTerms(StatementContainer $stmt, $terms)
{
if ($terms instanceof Models) {
$terms = $terms->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
Function array_get
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function array_get($array, $key, $default = null)
{
if ($array instanceof \Slim\Collection) {
$array = $array->all();
}
- 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 migrate
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function migrate($action = 'up')
{
$migrated = 0;
try {
Method listen
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function listen(array $argv = [])
{
$this->climate->description(config('app.description'));
$this->climate->arguments->add([
'help' => [
Function normalizeDefinition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function normalizeDefinition($key, $value)
{
if (is_numeric($key) && in_array($value, ['null', null])) {
$key = $value;
$value = true;
- 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 execute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(Console\Commands $command, $args)
{
$this->climate->arguments->description($command->description());
foreach ($command->arguments() as $name => $options) {
Method migratePhp
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function migratePhp($filepath, $action = 'up')
{
$migration = require $filepath;
$callable = null;
$schema = $this->newBlueprint();
Function migrate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function migrate($action = 'up')
{
$migrated = 0;
try {
- 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 renderExeption
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function renderExeption(\Exception $exception)
{
$message = $exception->getMessage();
if ($code = $exception->getCode()) {
$message = sprintf('[%s] %s', $code, $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"
Further reading
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($name = 'slim-config', array $settings = [])
{
$this->name = $name;
$this->monolog = new Monolog($this->name);
$this->settings = array_merge($this->settings, $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
Method attaches
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function attaches($filepath, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment')
Method attaches
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function attaches($filepath, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment');
Method join
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function join($model, $first = null, $operator = '=', $second = null, $joinType = 'INNER')
Function normalizeColumns
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function normalizeColumns($columns)
{
foreach ($columns as $column => $definition) {
if (!is_numeric($column) && is_array($definition)) {
continue;
- 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 input
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function input($prompt, $default = '', $acceptable = null, $strict = false)
{
if ($this->hasSttyAvailable()) {
$input = $this->climate->input($prompt);
- 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 execute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(Console\Commands $command, $args)
{
$this->climate->arguments->description($command->description());
foreach ($command->arguments() as $name => $options) {
- 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 function ($data, array $rules) use ($container) {
if ($data instanceof ServerRequestInterface) {
$data = $data->getParsedBody();
}