Showing 47 of 47 total issues
Method uploadImageOnServer
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function uploadImageOnServer($imageFile, $imageName, $imageSubdir, $imageWidth, $thumbWidth)
Function handle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function handle($request, Closure $next)
{
/* LEFT Menu */
\Menu::make('MyNavBar', function ($menu) {
$profile = $menu->add('home')->link->href('/');
- 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 get_files
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function get_files($images_dir, $exts = ['jpg'])
{
$files = [];
if ($handle = opendir($images_dir)) {
- 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 too many return
statements within this method. Open
return view('eventSearch.index', compact('events'))
->with('i', (request()->input('page', 1) - 1) * 20)
->with('eventCategories', $eventCategories)
->with('continents', $continents)
->with('countries', $countries)
Avoid too many return
statements within this method. Open
return "<?php echo date('g.i a', strtotime($expression))?>";
Function getDonationStatusBadge
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getDonationStatusBadge($status)
{
switch ($status) {
case 1:
$ret = "<span class='badge badge-success float-right'>".__('donations.status_available').'</span>';
- 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 contactFormSend
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function contactFormSend(Request $request)
{
// Validate form datas
/*$validator = Validator::make($request->all(), [
'name' => 'required',
- 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"