Showing 495 of 495 total issues
File Aggregate.php
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
File MovementsController.php
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
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
File UsersController.php
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
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 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
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
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 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
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
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);