Showing 31 of 31 total issues
ModelCollection
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ModelCollection extends DynamicCollection implements DynamicCollectionInterface
{
/** @var string|\Colibri\Database\Model */
protected static $itemClass = 'itemClass_not_set';
/** @var array */
Model
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Model
{
const NEW_OBJECT = -1;
/** @var string */
Command
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Command extends SymfonyCommand
{
const COMMAND_NS = 'Application\Command\\';
/** @var InputInterface */
Query
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Query
{
/** @var \Colibri\Database\AbstractDb\DriverInterface */
private $db;
/** @var string */
File Model.php
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Colibri\Database;
use Carbon\Carbon;
use Colibri\Database\Exception\NotFoundException;
File ModelCollection.php
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Colibri\Database;
use Colibri\Base\DynamicCollection;
use Colibri\Base\DynamicCollectionInterface;
Layout
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Layout extends Helper
{
/**
* @var string name of layout template to use
*/
Validation
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Validation
{
/** @var string */
public static $requiredMessage = 'поле \'%s\' является обязательным для заполнения.';
/** @var string */
Method calcResizeParams
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function calcResizeParams($resizeType, $img, $tmbWidth, $tmbHeight)
{
list($width, $height) = self::getImageSize($img);
switch ($resizeType) {
Method prepareValue
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareValue(&$value, $type)
{
if ($value === null) {
return $value = 'NULL';
}
Method build
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function build(Query $query): string
{
$this->query = $query;
$sql = $this->buildQueryStart();
Function isEqual
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function isEqual(array $keys, $message = null)
{
$existingKey = null;
foreach ($keys as $key) {
if (isset($this->scope[$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 calcResizeParams
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function calcResizeParams($resizeType, $img, $tmbWidth, $tmbHeight)
{
list($width, $height) = self::getImageSize($img);
switch ($resizeType) {
- 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 prepareValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function prepareValue(&$value, $type)
{
if ($value === null) {
return $value = 'NULL';
}
- 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 generateGUID
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function generateGUID(): string
{
$guidStr = '';
for ($i = 1; $i <= 16; $i++) {
$b = (int)mt_rand(0, 0xff);
- 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 send
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function send(string $to, string $subject, string $view, array $viewVars = [], $builder = null, $from = 'default')
Method call
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function call(string $division, string $module, string $class, string $method, array $params)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($host, $login, $pass, $database, $persistent = false)
Method createThumbnail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function createThumbnail($path, $width = 100, $height = 100, $resizeType = self::RESIZE_FILLED, $bgColor = 0xfff5ee)
Function required
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function required($key, $message = null)
{
if (is_array($key)) {
foreach ($key as $name) {
$this->required($name, $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"