Showing 494 of 494 total issues
File UsersService.php
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Services;
use App\Exceptions\AuthException;
Method minimumRedux
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function minimumRedux($modifiers)
{
if ($modifiers->isEmpty()) {
return [];
}
Method run
has 67 lines of code (exceeds 25 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'];
Product
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Product extends Model
{
use HasFactory, SoftDeletes, ProductConcept, TracksUpdater, Priceable, ModifiableTrait, GASModel, SluggableID, Cachable;
public $incrementing = false;
BookedProduct
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class BookedProduct extends Model
{
use HasFactory, GASModel, SluggableID, TracksUpdater, ModifiedTrait, LeafReducibleTrait, Cachable;
public $incrementing = false;
Method importXML
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function importXML($xml, $replace, $supplier_id)
{
if (is_null($replace)) {
$product = new Product();
$product->supplier_id = $supplier_id;
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
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
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');
Movement
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Movement extends Model
{
use HasFactory, TracksUpdater, GASModel;
/*
Role
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Role extends Model
{
use HasFactory, GASModel, Cachable;
private $real_targets = null;
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
File callables.js
has 267 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 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 unrollPeriodic
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
function unrollPeriodic($value)
{
if (!isset($value->from) || !isset($value->to)) {
return [];
}