Showing 265 of 306 total issues
File Builder.php
has 539 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of the Antares package.
*
Function action
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
protected function action($command)
{
// make sure we don't compress "a + ++b" to "a+++b", etc.
if ($command === self::ACTION_DELETE_A_B && $this->b === ' ' && ($this->a === '+' || $this->a === '-')) {
// Note: we're at an addition/substraction operator; the inputIndex
- 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
File helpers.php
has 470 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of the Antares package.
*
Method getFunctions
has 181 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFunctions()
{
return [
new Twig_SimpleFunction('memorize', function ($key, $default = null) {
return app('antares.platform.memory')->get($key, $default);
BaseEngine
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class BaseEngine implements DataTableEngineContract
{
/**
* Datatables Request object.
File BaseEngine.php
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of the Antares package.
*
Function getClientIP
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function getClientIP()
{
if (getenv('HTTP_CLIENT_IP')) {
$ipaddress = getenv('HTTP_CLIENT_IP');
} else if (getenv('HTTP_X_FORWARDED_FOR')) {
- 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
Builder
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class Builder extends BaseBuilder
{
/**
* defered data
User
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class User extends Eloquent implements UserContract, CanResetPasswordContract, Recipient, Taggable, Commentable, AuthorizableContract
{
use Authenticatable,
Authorizable,
Method render
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($request, Exception $e)
{
if ($e instanceof ValidationException) {
return parent::render($request, $e);
}
Function min
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function min()
{
if ($this->output !== '') { // min already run
return $this->output;
}
- 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 prepareToSave
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareToSave($classname, array $params = [], array $paramsFromSession = null)
{
$column = $params['column'];
$return = [];
if (is_null($paramsFromSession)) {
- 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 generateScripts
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generateScripts()
{
app('antares.asset')->container('antares/foundation::application')
->add('gridstack', '/webpack/view_datatables.js', ['webpack_gridstack', 'app_cache'])
Function decorate
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public static function decorate($value, $safe = false)
{
if (is_string($value)) {
if (strpos($value, 'js:') === 0 && $safe === false)
return substr($value, 3);
- 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
File QueryBuilderEngine.php
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Part of the Antares package.
*
Function adapt
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function adapt(Grid &$grid)
{
$this->grid = $grid;
$customfields = app('customfields')->get();
if (empty($customfields)) {
- 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 updatePermissions
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function updatePermissions($name, $values, $isNew = false, $brandId = null)
{
try {
if ($name === null) {
return false;
- 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 action
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function action($command)
{
// make sure we don't compress "a + ++b" to "a+++b", etc.
if ($command === self::ACTION_DELETE_A_B && $this->b === ' ' && ($this->a === '+' || $this->a === '-')) {
// Note: we're at an addition/substraction operator; the inputIndex
AbstractType
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class AbstractType implements Attributable
{
use AttributesTrait;
Function getFunctions
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getFunctions()
{
return [
new Twig_SimpleFunction('memorize', function ($key, $default = null) {
return app('antares.platform.memory')->get($key, $default);
- 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"