Showing 437 of 494 total issues
File ModifierEngine.php
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Singletons;
use Illuminate\Support\Facades\Log;
Function iconsLegendTrigger
has 55 lines of code (exceeds 25 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
Method handleShipping
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleShipping($obj, $request)
{
$action = $request['action'] ?? 'download';
$subtype = $request['format'] ?? 'pdf';
$status = $request['status'] ?? 'pending';
File Products.php
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Importers\CSV;
use DB;
File summary.blade.php
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
$summary = $master_summary->orders[$order->id];
$columns = $currentgas->orders_display_columns;
Method handleSummary
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleSummary($obj, $request)
{
$action = $request['action'] ?? 'download';
$subtype = $request['format'] ?? 'pdf';
$extra_modifiers = $request['extra_modifiers'] ?? 0;
Function targetDefinition
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function targetDefinition($modifier, $value)
{
if ($modifier->scale == 'minor') {
foreach($modifier->definitions as $def) {
if ($value < $def->threshold) {
- 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 getBookingsAttribute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function getBookingsAttribute()
{
$ret = [];
foreach ($this->orders as $order) {
- 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 widgets.js
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
require('bootstrap-datepicker');
require('select2');
import utils from "./utils";
Function updateBookingQuantities
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
static updateBookingQuantities(dynamic_data, container, action)
{
for (let [product_id, product_meta] of Object.entries(dynamic_data)) {
var inputbox = $('input[name="' + product_id + '"]', container);
inputbox.closest('tr').find('.booking-product-price span').text(utils.priceRound(product_meta.total));
File UsersController.php
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
Method formattableColumns
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function formattableColumns($type = null)
{
$ret = [
'name' => (object) [
'name' => _i('Nome Prodotto'),
Method displayColumns
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function displayColumns()
{
$ret = [];
$gas = currentAbsoluteGas();
Function init
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
static init(container)
{
$('.triggers-all-checkbox', container).change(function() {
$(this).prop('disabled', true);
Method formatShipping
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formatShipping($order, $fields, $status, $shipping_place, $extra_modifiers)
{
$ret = (object) [
'headers' => $fields->headers,
'contents' => [],
Method update
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update($id, array $request)
{
$modifier = $this->show($id);
$this->testAccess($modifier);
Method output_csv
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function output_csv($filename, $head, $contents, $format_callback, $out_file = null)
{
$callback = function() use ($head, $contents, $format_callback, $out_file) {
$csv_separator = currentAbsoluteGas()->getConfig('csv_separator');
Function updateContacts
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function updateContacts($request)
{
$ids = [];
$types = [];
$values = [];
- 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 initOnce
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
static initOnce()
{
$('body').on('click', '.order-summary .toggle-product-abilitation', function() {
$('.order-summary tr.product-disabled').toggle();
})
Function bookingTotal
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
static bookingTotal(editor) {
var form = $(editor).closest('form');
var data = this.serializeBooking(form);
var url = form.attr('data-dynamic-url');