Showing 441 of 501 total issues
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'] ?? [];
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 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 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;
File edit.blade.php
has 286 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;
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;
}
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 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 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 [];
}
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;
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;
Method list
has 65 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
File BookedProduct.php
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
Method run
has 65 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'];