Showing 437 of 494 total issues
Method saving
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function saving(Movement $movement)
{
if ($this->movements_hub->isSuspended()) {
return true;
}
Method update
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update(Request $request, $id)
{
DB::beginTransaction();
$user = Auth::user();
Method retrievePreSelectedFields
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function retrievePreSelectedFields($parameters)
{
$selected = [];
if (isset($parameters['sorted_fields']) && empty($parameters['sorted_fields']) == false) {
Function applyDefinition
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function applyDefinition($booking, $modifier, $amount, $definition, $target)
{
list($quantity_attribute, $price_attribute, $weight_attribute) = $this->applicationOffsets($booking);
$reference_quantity = 1;
- 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 hasWarningWithinOrder
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function hasWarningWithinOrder($summary)
{
if (isset($summary->products[$this->id])) {
$quantity = $summary->products[$this->id]->quantity;
- 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 postFeedback
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function postFeedback(Request $request, $id)
{
$ret = [];
if ($id == 'booking-payment') {
- 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 index
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function index(Request $request)
{
try {
$data['movements'] = $this->service->list($request->all());
$ret = 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 getBooked
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getBooked($product_id, $fallback = false)
{
if (is_object($product_id)) {
$product = $product_id;
$product_id = $product_id->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 duplicateAllCurrentBalances
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function duplicateAllCurrentBalances($latest_date)
{
$current_status = [];
$currencies = \App\Currency::enabled();
- 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 fillParameters
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function fillParameters($gas, $params)
{
$params['gas_name'] = $gas->name;
foreach(array_keys($this->params()) as $identifier) {
- 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 notify
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function notify($supplier, $e)
{
$body = _i('Nuovo aggiornamento disponibile per il listino %s (%s). Consultalo dal pannello Fornitori -> Indice Remoto.', [$supplier->printableName(), printableDate($e->lastchange)]);
if (Notification::where('content', $body)->first() == null) {
$gas = Gas::all();
- 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 defaultOrders
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function defaultOrders($mine)
{
if ($mine) {
$user = Auth::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 getSummary
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getSummary($start, $end, $type, $target)
{
if ($type == 'all') {
$data = $this->basicSummaryForAll($start, $end, $target);
}
- 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 applications
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function applications($all = false, $exclude_trashed = false, $target_class = null)
{
$this->appliesCache();
if ($all) {
- 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 guessByOrder
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function guessByOrder($order)
{
$contacts = $order->showableContacts();
if ($contacts->isEmpty()) {
$roles = Role::havingAction('supplier.orders');
- 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 apply
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function apply($movement)
{
$o = $this->opsByMethod($movement->method);
if ($o) {
- 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 iconsLegend
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function iconsLegend($contents = null)
{
$ret = [];
$box = self::myIconsBox();
- 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 formatSummaryShipping
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function formatSummaryShipping($order, $fields, $status, $shipping_place, $extra_modifiers)
{
$rows = [];
$total = 0;
$formattable = OrderFormatter::formattableColumns('summary');
- 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 formatSummary
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function formatSummary($order, $document, $fields, $status, $shipping_place, $extra_modifiers)
{
if ($shipping_place && $shipping_place == 'all_by_place') {
$places = Delivery::orderBy('name', 'asc')->get();
foreach($places as $place) {
- 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 getContactsByType
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getContactsByType($type)
{
$ret = [];
if (is_array($type) == 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"