Showing 494 of 494 total issues
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"
Further reading
Function select
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
select: function(event, ui) {
var aggregate_id = input.attr('data-aggregate');
var while_shipping = (input.closest('.modal.add-booking-while-shipping').length != 0);
var fill_target = input.closest('.fillable-booking-space').find('.other-booking');
fill_target.empty().append(utils.j().makeSpinner());
Method testAccess
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function testAccess($modifier)
{
switch($modifier->target_type) {
case 'App\Supplier':
$this->ensureAuth(['supplier.modify' => $modifier->target]);
Method getHistoryDetails
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getHistoryDetails(Request $request)
{
$this->checkAuth();
$date = $request->input('date');
Method handleSave
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleSave($gas, $request)
{
$satispay_info = null;
if ($request->has('enable_satispay')) {
Method notify
has 27 lines of code (exceeds 25 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();
Method exportIntegralCES
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function exportIntegralCES($gas, $objects, $filename, $body)
{
$currency = Currency::where('context', 'integralces')->first();
return output_csv($filename, null, $objects, function($object) use ($gas, $currency, $body) {