Showing 437 of 494 total issues
Function document
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function document(Request $request, $type, $subtype = 'none')
{
$user = $this->checkAuth();
switch ($type) {
- 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 computeStrings
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function computeStrings()
{
$names = [];
$dates = [];
- 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 utils.js
has 309 lines of code (exceeds 250 allowed). Consider refactoring. Open
require('continous-calendar');
import jBob from "jbob";
import Lists from "./lists";
File MovementsService.php
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Services;
use App\Exceptions\IllegalArgumentException;
Aggregate
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Aggregate extends Model
{
use HasFactory, GASModel, ModifiableTrait, ReducibleTrait, WithinGas;
protected $dispatchesEvents = [
Function init
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
static init(container)
{
$('.reloader', container).click(function(e) {
var listid = $(this).attr('data-reload-target');
Function updateAccessType
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function updateAccessType($id, $request)
{
$user = Auth::user();
if (is_null($user)) {
throw new AuthException(401);
- 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 init
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
static init(container)
{
$('.icons-legend button, .icons-legend a', container).click((e) => {
e.preventDefault();
this.iconsLegendTrigger($(e.currentTarget), '.icons-legend');
File Role.php
has 299 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
Callables
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Callables {
static attachUserRole(role_id, user_id, target_id, target_class) {
utils.postAjax({
method: 'POST',
url: 'roles/attach',
File edit.blade.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
$more_orders = ($aggregate->orders->count() > 1);
$handling_movements = someoneCan('movements.admin', $currentgas);
$tot_amount = 0;
Method displayColumns
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function displayColumns()
{
$ret = [
'selection' => (object) [
'label' => _i('Selezione'),
Function systemInit
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function systemInit($mov)
{
$mov->callbacks = [
'pre' => function (Movement $movement) {
/*
- 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 paymentsByType
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
function paymentsByType($type)
{
$ret = [];
if ($type != 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 minimumRedux
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function minimumRedux($modifiers)
{
if ($modifiers->isEmpty()) {
return [];
}
- 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 Product.php
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
File BookingsService.php
has 292 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Services;
use Illuminate\Support\Collection;
Function aggregator
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.aggregator = function() {
$(this).each(function() {
$(this).find('div.card').each(function() {
initAggregatorList($(this));
});
Function generalInit
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generalInit(container) {
if (container == null) {
container = $('body');
}
Method handleShipping
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleShipping($obj, $request)
{
$subtype = $request['format'] ?? 'pdf';
$required_fields = $request['fields'] ?? [];