Showing 437 of 494 total issues
Method serializeTransformations
has 47 lines of code (exceeds 25 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']));
Method handle
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$this->doAlways();
/*
Method importJSON
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function importJSON($supplier, $json, $replace)
{
if (is_null($replace)) {
$product = new Product();
}
Method fields
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fields()
{
return [
'name' => (object) [
'label' => _i('Nome'),
Method update
has 45 lines of code (exceeds 25 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'));
Method handle
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$printer = new OrderPrinter();
$notifiable_users = [];
$all_files = [];
Method handlingAttributes
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handlingAttributes($booking, $modifier, $attribute)
{
/*
Se l'ordine è chiuso (ma non consegnato e archiviato) attingo dai
valori relativi, che includono sia il consegnato che il prenotato ma
Method orders
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function orders()
{
static $ret = null;
if (is_null($ret)) {
Function ensureAuth
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function ensureAuth($permissions = [], $or = true)
{
$user = Auth::user();
if (is_null($user)) {
- 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 store
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function store(Request $request)
{
DB::beginTransaction();
$data = $request->input('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
Function show
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function show(Request $request, $id)
{
$user = Auth::user();
$format = $request->input('format', 'html');
- 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 calculateModifiers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function calculateModifiers($aggregate_data = null, $real = true)
{
$values = new Collection();
$modifiers = $this->involvedModifiers();
- 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 getSupplier
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function getSupplier($start, $end, $type, $target, $supplier)
{
$data = [];
$categories = [];
- 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 updateRecursive
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function updateRecursive($data, $parent, &$accumulator)
{
foreach ($data as $category) {
$c = 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 appliesCache
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function appliesCache()
{
if (is_null($this->applies_cache)) {
$applies_cache = [];
$applies_only_cache = [];
- 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 doPayment
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doPayment(Request $request)
{
$type = $request->input('type');
if ($type == 'satispay') {
Method run
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run($request)
{
$imports = $request->input('import', []);
$dates = $request->input('date', []);
$senders = $request->input('sender_id', []);
Method calculateInvoicingSummary
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function calculateInvoicingSummary()
{
$summary = (object) [
'order' => $this->id,
'total' => 0,
Function movementTypeEditor
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
static movementTypeEditor(container)
{
$('select[name=sender_type], select[name=target_type]', container).change(function(e) {
var editor = $(this).closest('.movement-type-editor');
var sender = editor.find('select[name=sender_type] option:selected').val();
Method formattableColumns
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function formattableColumns($type = null)
{
$ret = [
'lastname' => (object) [
'name' => _i('Cognome'),