Showing 437 of 494 total issues
Method columnsByFeatures
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function columnsByFeatures($ret)
{
$current_gas = currentAbsoluteGas();
if ($current_gas->hasFeature('shipping_places')) {
Method handle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(VariantChanged $event)
{
$product = $event->variant->product;
/*
Function testAccess
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function testAccess($modifier)
{
switch($modifier->target_type) {
case 'App\Supplier':
$this->ensureAuth(['supplier.modify' => $modifier->target]);
- 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 postGdxp
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function postGdxp(Request $request)
{
// try {
$archivepath = '';
$working_dir = sys_get_temp_dir();
- 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 iconsLegendTrigger
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static iconsLegendTrigger(node, legend_class)
{
/*
Se clicco l'intestazione di un dropdown, passo oltre. Qui interviene
il JS di Bootstrap per aprire e chiudere il dropdown stesso
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$hub = app()->make('GlobalScopeHub');
$gas = $hub->getGasObj();
- 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 postFixes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function postFixes(Request $request, $id)
{
DB::beginTransaction();
$order = $this->service->show($id, true);
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
$suppliers = Supplier::whereNotNull('remote_lastimport')->get();
if ($suppliers->isEmpty() == false) {
- 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 printableDate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function printableDate($value, $short = false)
{
if (is_null($value) || empty($value)) {
return _i('Mai');
}
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function handle(VariantChanged $event)
{
$product = $event->variant->product;
/*
- 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 testApplication
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function testApplication($obj, $cache_type)
{
$this->appliesCache();
$class = get_class($obj);
- 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 guessReplyTo
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function guessReplyTo($message, $from)
{
try {
$reply = 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 hasBrokenModifier
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function hasBrokenModifier()
{
if ($this->id == 'booking-payment') {
$types = Modifier::has('movementType')->pluck('movement_type_id')->unique();
$types = MovementType::whereIn('id', $types)->get();
- 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 organizeForProducts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function organizeForProducts(&$products_modifiers, $target_modifiers, $key): void
{
foreach($target_modifiers as $pmod) {
if ($pmod->target_type == BookedProduct::class) {
$mod_id = $pmod->modifier->modifier_type_id;
- 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 readVariants
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readVariants($product, $booked, $values, $quantities, $delivering)
{
$param = $this->handlingParam($delivering);
$quantity = 0;
$saved_variants = [];
Method updateOrders
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateOrders(array $request)
{
$user = $this->ensureAuth(['supplier.orders' => null]);
$suppliers = array_keys($user->targetsByAction('supplier.orders'));
Function content
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
content: function() {
var ret = '<div>\
<div class="row mb-2"><label for="password" class="col-4 col-form-label">' + _('Nuova Password') + '</label><div class="col-8"><input type="password" class="form-control" name="password" value="" autocomplete="off" minlength="8"></div></div>\
<div class="row mb-2"><label for="password_confirm" class="col-4 col-form-label">' + _('Conferma Password') + '</label><div class="col-8"><input type="password" class="form-control" name="password_confirm" value="" autocomplete="off" minlength="8"></div></div>';
Method readGdxpFile
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readGdxpFile($path, $execute, $supplier_replace)
{
$working_dir = sys_get_temp_dir();
$data = [];
Method fastShipping
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fastShipping($deliverer, $aggregate, $users = null)
{
DB::beginTransaction();
$service = app()->make('BookingsService');
Method productByString
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function productByString($string, $products = null)
{
if (is_null($products)) {
$products = App\Product::all();
}