Showing 437 of 494 total issues
File bookings.js
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
import utils from "./utils";
import Modifiers from "./modifiers";
class Bookings
{
Function miscInnerCallbacks
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
function miscInnerCallbacks(form, data) {
if (locker == true) {
return false;
}
Function importXML
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public static function importXML($xml, $replace, $supplier_id)
{
if (is_null($replace)) {
$product = new Product();
$product->supplier_id = $supplier_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
Function handleSummary
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
protected function handleSummary($obj, $request)
{
$action = $request['action'] ?? 'download';
$subtype = $request['format'] ?? 'pdf';
$extra_modifiers = $request['extra_modifiers'] ?? 0;
- 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 run
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
$gas = Gas::where('name', '!=', '')->first();
$gas->name = 'GAS Demo';
- 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 dynamictree
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.dynamictree = function() {
$(this).each(function() {
$(this).find('.dynamic-tree').sortable({
items: 'li',
connectWith: '.dynamic-tree ul',
Method select
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function select($request)
{
$user = Auth::user();
$service = app()->make('BookingsService');
$errors = [];
Method apply
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function apply($modifier, $booking, $aggregate_data)
{
if ($modifier->active == false) {
Log::debug('Modificatore non attivo, ignoro applicazione');
return null;
Method document
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function document(Request $request, $type, $subtype = 'none')
{
$user = $this->checkAuth();
switch ($type) {
Function serializeTransformations
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
function serializeTransformations($target, $json_target)
{
$transformations = [];
$modifiers = $target->modifiers->filter(fn($m) => $m->active && in_array($m->modifierType->identifier, ['shipping', 'discount']));
- 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 importXML
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public static function importXML($xml, $replace)
{
if (is_null($replace)) {
$supplier = new Supplier();
$supplier->payment_method = '';
- 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 handleShipping
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
protected function handleShipping($obj, $request)
{
$action = $request['action'] ?? 'download';
$subtype = $request['format'] ?? 'pdf';
$status = $request['status'] ?? 'pending';
- 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 select
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function select($request)
{
list($reader, $columns) = $this->initRead($request);
$target_separator = ',';
Function output_csv
has a Cognitive Complexity of 25 (exceeds 5 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');
- 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 unrollPeriodic
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
function unrollPeriodic($value)
{
if (!isset($value->from) || !isset($value->to)) {
return [];
}
- 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 run
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run($request)
{
DB::beginTransaction();
list($reader, $columns) = $this->initRead($request);
Method select
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function select($request)
{
list($reader, $columns) = $this->initRead($request);
list($name_index, $supplier_code_index) = $this->getColumnsIndex($columns, ['name', 'supplier_code']);
$s = $this->getSupplier($request);
Function init
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
static init(container)
{
if (container.hasClass('modifier-modal')) {
container.find('form').addClass('form-disabled');
Function sumUpProducts
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function sumUpProducts($booking, &$datarow)
{
/*
TODO: Nel caso di prenotazioni salvate sarebbe molto più efficiente
cambiare semplicemente lo stato della prenotazione stessa, giacché
- 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 list
has a Cognitive Complexity of 24 (exceeds 5 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
- 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"