Showing 437 of 494 total issues
Avoid too many return
statements within this method. Open
return output_csv($filename, $data->headers, $flat_contents, function($row) {
return $row;
});
Function creditHistory
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function creditHistory($class, $date)
{
$currencies = Currency::enabled();
$balances = Balance::whereDate('date', $date)->where('target_type', $class)->get();
$ret = [];
- 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 queryMovements
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function queryMovements($query = null, $type = 'all')
{
if (is_null($query)) {
$query = Movement::orderBy('created_at', 'desc');
}
- 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 fastShipping
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function fastShipping($deliverer, $aggregate, $users = null)
{
DB::beginTransaction();
$service = app()->make('BookingsService');
- 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 saveValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function saveValue($modifier, $obj_mod_target, $altered_amount)
{
$modifier_value = $this->retrieveExistingValue($modifier, $obj_mod_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 dispatchToReferents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function dispatchToReferents($notifiable_users)
{
foreach($notifiable_users as $notifiable) {
if ($notifiable->user->gas->auto_referent_order_summary) {
try {
- 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 getPrintableUpdaterAttribute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getPrintableUpdaterAttribute()
{
$last_update = null;
$last_updater = 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 attachUser
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function attachUser($user_id, $role_id, $target)
{
$this->checkAccessToRole($role_id);
$r = Role::findOrFail($role_id);
$u = User::tFind($user_id, 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 revisioned
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function revisioned($id, $approved)
{
DB::beginTransaction();
$user = $this->show($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 enforceMeasureDiscrete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function enforceMeasureDiscrete(node) {
var form = node.closest('form');
var selected = node.find('option:selected').val();
var discrete = measure_discrete[selected];
var disabled = (discrete == '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 list
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function list($start, $end, $supplier_id, $user_id = 0)
{
if ($user_id == '0') {
$this->ensureAuth(['movements.admin' => 'gas']);
}
- 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 destroy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function destroy($id)
{
$product = DB::transaction(function() use ($id) {
$product = $this->show($id);
$this->ensureAuth(['supplier.modify' => $product->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 evaluateEmptyBooking
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static evaluateEmptyBooking(form) {
if (form.find('input:hidden[name=action]').val() == 'shipped') {
var test = false;
form.find('.booking-total').each(function() {
- 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 unalignedPrices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function unalignedPrices($product)
{
$to_change = [];
$orders = $product->supplier->active_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 create
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function create(Request $request)
{
$type = $request->input('type', null);
if (is_null($type)) {
return view('movement.create');
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public function show(Request $request, $id)
{
$receipt = $this->service->show($id);
$user = $request->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 iterateUsers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function iterateUsers($users, $gas, $amount)
{
$auto_fee = $gas->getConfig('auto_fee');
foreach($users as $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 someoneCan
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function someoneCan($permission, $subject = null)
{
$basic_roles = App\Role::havingAction($permission);
foreach($basic_roles as $br) {
- 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 systemParameters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function systemParameters($type)
{
static $types = [];
if (!isset($types[$type])) {
- 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 columnsByFeatures
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function columnsByFeatures($ret)
{
$current_gas = currentAbsoluteGas();
if ($current_gas->hasFeature('shipping_places')) {
- 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"