Showing 23 of 47 total issues
File edit.blade.php
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
@extends('donationOffers.layout')
@section('content')
<div class="container max-w-lg px-0">
File create.blade.php
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
@extends('donationOffers.layout')
@section('content')
<div class="container max-w-lg px-0">
File index.blade.php
has 282 lines of code (exceeds 250 allowed). Consider refactoring. Open
{{-- @extends('layouts.app') --}}
@extends('layouts.hpEventSearch')
@section('javascript-document-ready')
@parent
Method handle
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle($request, Closure $next)
{
/* LEFT Menu */
\Menu::make('MyNavBar', function ($menu) {
$profile = $menu->add('home')->link->href('/');
Method index
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index(Request $request)
{
$cacheExpireTime = 900; // expressed in seconds (15 min)
$backgroundImages = BackgroundImage::all();
Method register
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function register(Request $request)
{
/** @var User $user */
// Validate form datas
Method createLinesChart
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createLinesChart($daysRange)
{
$lastIDUpdatedStats = \DB::table('statistics')->max('id');
/* Registered users*/
Method contactFormSend
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function contactFormSend(Request $request)
{
// Validate form datas
/*$validator = Validator::make($request->all(), [
'name' => 'required',
Method boot
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function boot()
{
// FIX THE LOCALE BUG WITH CARBON - https://vegibit.com/what-is-a-view-composer-in-laravel/
View::composer('*', function ($view) {
$locale = App::getLocale();
Function getGallery
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getGallery($postBody, $storagePath, $publicPath)
{
// Find plugin occurrences
$ptn = '/{# +gallery +(src|width|height)=\[(.*)\] +(src|width|height)=\[(.*)\] +(src|width|height)=\[(.*)\] +#}/';
- 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 prepareCommunityGoals
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareCommunityGoals($parameters)
{
$ret = "<div class='communityGoals'>";
$ret .= "<div class='card'>";
Function generateThumbs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function generateThumbs($images_dir, $thumbs_dir, $thumbs_size, $image_files)
{
// Thumbnails size
$thumbs_width = $thumbs_size['width'];
$thumbs_height = $thumbs_size['height'];
- 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 wrapImageWithAlt
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function wrapImageWithAlt(thisObj){
// Crea un DIV per inserire la descrizione sotto all'immagine sempre nel wrap
// Incapsula l'immagine con ALT della sezione news in un contenitore
Method show
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show(Post $post)
{
// Accordion
$accordionClass = new AccordionClass();
$post->body = $accordionClass->getAccordion($post->body);
Method index
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index(Request $request)
{
$categories = Category::getCategoriesArray();
$searchKeywords = $request->input('keywords');
Method prepareStatsDonate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareStatsDonate($parameters)
{
$ret = "<div class='statisticsDonate'>";
$ret .= "<h3 class='text-center mb-2'>Some numbers about the project</h3>";
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)