Showing 437 of 494 total issues
Function handlePreProcess
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function handlePreProcess($request, $booking)
{
$manual_total = $this->deliveringManualTotal($request, $booking->order);
if ($manual_total > 0) {
$booking->enforceTotal($manual_total);
- 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 descriptions
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function descriptions($target)
{
/*
Qui predispongo le stringhe descrittive per tutte le possibili
combinazioni di valori, destinate a rendere più comprensibile la
- 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 postFeedback
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function postFeedback(Request $request, $id)
{
$ret = [];
$aggregate = Aggregate::findOrFail($id);
$master_summary = 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 compareBalances
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public static function compareBalances($old_balances)
{
$diff = [];
foreach($old_balances as $currency_id => $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
Method startTour
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function startTour(Request $request)
{
$user = $request->user();
$gas = $user->gas;
Function setupPermissionsEditor
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
static setupPermissionsEditor(container) {
$('.roleAssign', container).each(function() {
if ($(this).hasClass('tt-hint') == true) {
return;
}
UsersController
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class UsersController extends BackedController
{
public function __construct(UsersService $service)
{
$this->commonInit([
File BookedProduct.php
has 284 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
Method list
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function list($request)
{
/*
TODO sarebbe assai più efficiente usare with('sender') e
with('target'), ma poi la relazione in Movement si spacca (cambiando
Function parseRules
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function parseRules(&$data, $role, $classname, $request)
{
$payments = paymentTypes();
$valid_payments = array_intersect_key($request, $payments);
$fields = (new $classname())->balanceFields();
- 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 registerPolicies
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function registerPolicies()
{
$all_permissions = allPermissions();
foreach ($all_permissions as $rules) {
- 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 readVariants
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function readVariants($product, $booked, $values, $quantities, $delivering)
{
$param = $this->handlingParam($delivering);
$quantity = 0;
$saved_variants = [];
- 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 update
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function update($id, array $request)
{
if ($id == 0) {
$user = $this->ensureAuth(['supplier.orders' => null]);
$suppliers = array_keys($user->targetsByAction('supplier.orders'));
- 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 productByString
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
function productByString($string, $products = null)
{
if (is_null($products)) {
$products = App\Product::all();
}
- 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 20 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$orders = Order::where('status', 'open')->where('end', '>', Carbon::today()->format('Y-m-d'))->get();
$notifications = [];
- 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 hasChangedProdcts
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function hasChangedProdcts()
{
$has_changed_products = false;
if ($this->isActive()) {
- 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 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;