Showing 437 of 494 total issues
Method formatSummary
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function formatSummary($order, $document, $fields, $status, $shipping_place, $extra_modifiers)
Function importJSON
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function importJSON($supplier, $json, $replace)
{
if (is_null($replace)) {
$product = new Product();
}
- 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 transationRole
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function transationRole($obj_peer)
{
$ret = null;
if ($this->sender_id == $obj_peer->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
Method addModifiers
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function addModifiers($order, $summary, $status, $total, $fields, $extra_modifiers)
Function describingAttributesMerge
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function describingAttributesMerge($first, $second)
{
if (is_null($first)) {
return clone $second;
}
- 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 attachByRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function attachByRequest($request, $id = null)
{
$file = $request['file'] ?? null;
$url = $request['url'] ?? null;
$name = $request['name'] ?? '';
- 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
Avoid deeply nested control flow statements. Open
if (isset($datarow['variant_selection_' . $variant_id]) == false) {
$datarow['variant_selection_' . $variant_id] = [];
}
Function apply
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function apply(Builder $builder, Model $model)
{
$hub = App::make('GlobalScopeHub');
/*
- 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
Avoid deeply nested control flow statements. Open
if (isset($datarow['variant_quantity_' . $product_id]) == false) {
$datarow['variant_quantity_' . $product_id] = [];
}
Method applyDefinition
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function applyDefinition($booking, $modifier, $amount, $definition, $target)
Method readVariants
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function readVariants($product, $booked, $values, $quantities, $delivering)
Method handleBookingUpdate
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function handleBookingUpdate($request, $user, $order, $target_user, $delivering)
Method output_csv
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function output_csv($filename, $head, $contents, $format_callback, $out_file = null)
Method getSupplier
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function getSupplier($start, $end, $type, $target, $supplier)
Method formatSummaryShipping
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function formatSummaryShipping($order, $fields, $status, $shipping_place, $extra_modifiers)
Method mapSelection
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function mapSelection($objects, $param, $value, $field, &$product)
Method formatTableRows
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function formatTableRows($aggregate, $shipping_place, $status, $fields, &$all_products)
Method formatShipping
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function formatShipping($order, $fields, $status, $shipping_place, $extra_modifiers)
Method formatTableRows
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function formatTableRows($order, $shipping_place, $status, $fields, &$all_products)
Method formatProduct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function formatProduct($fields, $formattable, $product_redux, $product, $internal_offsets)