Showing 441 of 501 total issues
Function handlingAttributes
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function handlingAttributes($booking, $modifier, $attribute)
{
/*
Se l'ordine è chiuso (ma non consegnato e archiviato) attingo dai
valori relativi, che includono sia il consegnato che il prenotato ma
- 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 handle
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$printer = new OrderPrinter();
$notifiable_users = [];
$all_files = [];
- 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
Utils
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Utils {
static init(container)
{
$('.reloader', container).click(function(e) {
var listid = $(this).attr('data-reload-target');
BookedProduct
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class BookedProduct extends Model
{
use HasFactory, GASModel, SluggableID, TracksUpdater, ModifiedTrait, LeafReducibleTrait, Cachable;
public $incrementing = false;
Role
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Role extends Model
{
use HasFactory, GASModel, Cachable;
private $real_targets = null;
Movement
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Movement extends Model
{
use HasFactory, TracksUpdater, GASModel;
/*
Function tableFilters
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
static tableFilters(table_id)
{
var filters = $('[data-table-target="' + table_id + '"]');
var table = $('table' + table_id);
var elements = table.find('tbody tr');
Method importXML
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function importXML($xml, $replace)
{
if (is_null($replace)) {
$supplier = new Supplier();
$supplier->payment_method = '';
Method getValue
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getValue($type, $with_friends, $force_recalculate = false)
{
$key = sprintf('%s_%s', $type, $with_friends ? 'friends' : 'nofriends');
if ($force_recalculate) {
Function update
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function update($id, array $request)
{
$modifier = $this->show($id);
$this->testAccess($modifier);
- 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 readGdxpFile
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
private function readGdxpFile($path, $execute, $supplier_replace)
{
$working_dir = sys_get_temp_dir();
$data = [];
- 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 postStatusSES
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function postStatusSES(Request $request)
{
if (env('MAIL_MAILER') == 'ses') {
$message = Message::fromRawPostData();
$validator = new MessageValidator();
- 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 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
static init(container)
{
$('.loadable-list', container).each(function() {
Lists.testListsEmptiness($(this));
});
Method readBooking
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readBooking(array $request, $order, $booking, $delivering)
{
$param = $this->handlingParam($delivering);
if (isset($request['notes_' . $order->id])) {
Method systemInit
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function systemInit($mov)
{
$mov->callbacks = [
'pre' => function (Movement $movement) {
/*
Method unrollPeriodic
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function unrollPeriodic($value)
{
if (!isset($value->from) || !isset($value->to)) {
return [];
}
File callables.js
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
window.$ = window.jQuery = global.$ = global.jQuery = require('jquery');
require('bootstrap');
import utils from "./utils";
import lists from "./lists";
Function unrollSpecialSelectors
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function unrollSpecialSelectors($users)
{
$map = [];
if (!is_array($users)) {
- 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 run
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function run($request)
{
DB::beginTransaction();
$direct_fields = ['name', 'weight', 'description', 'price', 'supplier_code', 'package_size', 'min_quantity', 'multiple', 'portion_quantity'];
- 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 handleSummary
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function handleSummary($obj, $request)
{
$subtype = $request['format'] ?? 'pdf';
if ($subtype == 'gdxp') {
- 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"