Showing 437 of 494 total issues
Function getConvenientStringsAttribute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getConvenientStringsAttribute()
{
$suppliers = [];
$shipping_date = PHP_INT_MAX;
- 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 comparePrices
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function comparePrices($other)
{
if ($this->getPrice(false) != $other->getPrice(false)) {
return 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 selective
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function selective()
{
if (currentAbsoluteGas()->hasFeature('shipping_places')) {
return [
'truck' => (object) [
- 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 dispatchToSupplier
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function dispatchToSupplier($order)
{
if ($order->isRunning() == false) {
$supplier = $order->supplier;
- 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 dynamicModifiers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function dynamicModifiers(array $request, $aggregate, $target_user)
{
/*
Innanzitutto, qui sospendo l'esecuzione delle callback sui movimenti
contabili. Nella fase di revisione della prenotazione capita che i
- 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 postStatusScaleway
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function postStatusScaleway(Request $request)
{
if (env('MAIL_MAILER') == 'scaleway') {
$api_endpoint = 'https://api.scaleway.com/transactional-email/v1alpha1/regions/fr-par/webhooks';
- 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 saving
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function saving(Movement $movement)
{
if ($this->movements_hub->isSuspended()) {
return 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 unalignedModifiers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function unalignedModifiers($master_summary)
{
if ($this->isActive()) {
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 applyModifiers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function applyModifiers($aggregate_data = null, $enforce_status = false)
{
$modifiers = new Collection();
$order_modifiers = $this->involvedModifiers(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 roleByFunction
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function roleByFunction($identifier)
{
$gas = currentAbsoluteGas();
$role_id = $gas->roles[$identifier] ?? null;
$ret = App\Role::find($role_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 readProductQuantity
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function readProductQuantity($product, $field, $friends_bookings)
{
$combo = null;
if (is_a($product, VariantCombo::class)) {
- 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 retrievePreSelectedFields
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function retrievePreSelectedFields($parameters)
{
$selected = [];
if (isset($parameters['sorted_fields']) && empty($parameters['sorted_fields']) == 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 init
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
static init(container)
{
/*
Questo mostra/nasconde il trigger addizionale per modificare in
blocco l'ordinabilità dei prodotti, nella griglia della modifica
Method ensureAuth
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ensureAuth($permissions = [], $or = true)
{
$user = Auth::user();
if (is_null($user)) {
Method sumUpProducts
has 31 lines of code (exceeds 25 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é
Method create
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create(Request $request)
{
$type = $request->input('type', null);
if (is_null($type)) {
return view('movement.create');
Method postStatusScaleway
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postStatusScaleway(Request $request)
{
if (env('MAIL_MAILER') == 'scaleway') {
$api_endpoint = 'https://api.scaleway.com/transactional-email/v1alpha1/regions/fr-par/webhooks';
Method movementTypes
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function movementTypes($identifier = null, $with_trashed = false)
{
static $types = null;
if ($identifier == 'VOID') {
Method fields
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function fields()
{
$ret = [
'date' => (object) [
'label' => _i('Data'),
Method up
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
/*
Questa migrazione serve solo per il profiler, va adoperata per lo
sviluppo locale e non serve eseguirla sulle istanze di produzione