davide-casiraghi/ci-global-calendar

View on GitHub

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">
Severity: Minor
Found in resources/views/donationOffers/edit.blade.php - About 3 hrs to fix

    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">
    Severity: Minor
    Found in resources/views/donationOffers/create.blade.php - About 3 hrs to fix

      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
      Severity: Minor
      Found in resources/views/eventSearch/index.blade.php - About 2 hrs to fix

        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('/');
        Severity: Major
        Found in app/Http/Middleware/GenerateMenus.php - About 2 hrs to fix

          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();
          Severity: Minor
          Found in app/Http/Controllers/EventSearchController.php - About 2 hrs to fix

            Method register has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function register(Request $request)
                {
                    /** @var User $user */
            
                    // Validate form datas
            Severity: Minor
            Found in app/Http/Controllers/Auth/RegisterController.php - About 1 hr to fix

              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*/
              Severity: Minor
              Found in app/Http/Controllers/StatisticsController.php - About 1 hr to fix

                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',
                Severity: Minor
                Found in app/Http/Controllers/ContactFormController.php - About 1 hr to fix

                  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();
                  Severity: Minor
                  Found in app/Providers/AppServiceProvider.php - About 1 hr to fix

                    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)=\[(.*)\] +#}/';
                    
                    
                    Severity: Minor
                    Found in app/Classes/GalleryClass.php - About 1 hr to fix

                    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'>";
                    Severity: Minor
                    Found in app/Classes/CommunityGoalsClass.php - About 1 hr to fix

                      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'];
                      Severity: Minor
                      Found in app/Classes/GalleryClass.php - About 1 hr to fix

                      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
                      Severity: Minor
                      Found in resources/js/plugins/imagepopup.js - About 1 hr to fix

                        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);
                        Severity: Minor
                        Found in app/Http/Controllers/PostController.php - About 1 hr to fix

                          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');
                          Severity: Minor
                          Found in app/Http/Controllers/PostController.php - About 1 hr to fix

                            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>";
                            
                            
                            Severity: Minor
                            Found in app/Classes/StatsDonateClass.php - About 1 hr to fix

                              Method uploadImageOnServer has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  public function uploadImageOnServer($imageFile, $imageName, $imageSubdir, $imageWidth, $thumbWidth)
                              Severity: Minor
                              Found in app/Http/Controllers/Controller.php - About 35 mins to fix

                                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('/');
                                Severity: Minor
                                Found in app/Http/Middleware/GenerateMenus.php - About 35 mins to fix

                                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)) {
                                Severity: Minor
                                Found in app/Classes/GalleryClass.php - About 35 mins to fix

                                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)
                                Severity: Major
                                Found in app/Http/Controllers/EventSearchController.php - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language