Include statements should not be used

  • Minor
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/symfony.include_statement_used

  1. */
  2. protected function commands()
  3. {
  4. $this->load(__DIR__.'/Commands');
  5. require base_path('routes/console.php');

    Using include() or require() bypasses lazy-loading of third-party classes. Prefer using autoloading.

    Time to fix: about 3 hours
    Open Issue Permalink
    Last edited by studentneil
  6. }
  7. }

Source code should not contain TODO comments

  • Minor
  • Architecture

More information: https://insight.sensiolabs.com/what-we-analyse/task_todo_comment

  1. getMoment = function (d) {
  2. var returnMoment;
  3. if (d === undefined || d === null) {
  4. returnMoment = moment(); //TODO should this use format? and locale?

    TODO comments are left in the code when a feature (or a bug) isn't completely developed (or fixed). You should complete the implementation and remove the comment.

    Time to fix: about 4 hours
    Open Issue Permalink
    Last edited by studentneil
  5. } else if (moment.isDate(d) || moment.isMoment(d)) {
  6. // If the date that is passed in is already a Date() or moment() object,
  7. // pass it directly to moment.
  8. returnMoment = moment(d);
  9. } else if (hasTimeZone()) { // There is a string to parse and a default time zone

Object parameters should be type hinted

  • Minor
  • Bugrisk

More information: https://insight.sensiolabs.com/what-we-analyse/php.object_parameter_not_type_hinted

in routes/channels.php, line 14
  1. | application supports. The given channel authorization callbacks are
  2. | used to check if an authenticated user can listen to the channel.
  3. |
  4. */
  5. Broadcast::channel('App.User.{id}', function ($user, $id) {

    The parameter user, which is an object, should be typehinted.

    Time to fix: about 1 hour
    Open Issue Permalink
    Last edited by studentneil
  6. return (int) $user->id === (int) $id;
  7. });

User specific files should not appear in .gitignore

  • Minor
  • Codestyle

More information: https://insight.sensiolabs.com/what-we-analyse/git.user_specific_ignored_file

in .gitignore, line 7
  1. /public/hot
  2. /public/storage
  3. /public/node_modules
  4. /storage/*.key
  5. /vendor
  6. /.idea

    /.idea is user-specific and should not appear in a project .gitignore. Consider adding it to the user global .gitignore instead.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  7. /.vagrant
  8. Homestead.json
  9. Homestead.yaml
  10. npm-debug.log
  11. yarn-error.log

Templates should not be too long

  • Minor
  • Codestyle

More information: https://insight.sensiolabs.com/what-we-analyse/twig.template_too_long

8% of all your templates have more than 200 lines, the threshold is 5%.

Time to fix: about 2 hours
Open Issue Permalink
Collective

Commented code should not be committed 4

  • Minor
  • Deadcode

More information: https://insight.sensiolabs.com/what-we-analyse/php.commented_out_code

  1. | redirecting them to your home screen. The controller uses a trait
  2. | to conveniently provide its functionality to your applications.
  3. |
  4. */
  5. // use AuthenticatesUsers;

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by studentneil
  6. /**
  7. * Where to redirect users after login.
  8. *
  9. * @var string
  1. *
  2. * @return void
  3. */
  4. // public function __construct()
  5. // {
  6. // $this->middleware('guest')->except('logout');

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by studentneil
  7. // }
  8. public function showLoginForm()
  9. {
  10. return view('login');
in routes/web.php, line 26
  1. Route::get('/logout', 'LoginController@logoutAction');
  2. Route::post('/auth', 'LoginController@authenticate');
  3. Route::get('/admin/dashboard', function() {
  4. return view('dashboard');
  5. });
  6. //Auth::routes();

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by studentneil
  7. //Route::get('/home', 'HomeController@index')->name('home');
  8. Route::prefix('admin')->group(function () {
  9. Route::resource('camps', 'CampController');
in routes/web.php, line 28
  1. Route::get('/admin/dashboard', function() {
  2. return view('dashboard');
  3. });
  4. //Auth::routes();
  5. //Route::get('/home', 'HomeController@index')->name('home');

    Commented out code reduces readability and lowers the code confidence for other developers. If it's common usage for debug, it should not be committed. Using a version control system, such code can be safely removed.

    Time to fix: about 30 minutes
    Open Issue Permalink
    Last edited by studentneil
  6. Route::prefix('admin')->group(function () {
  7. Route::resource('camps', 'CampController');
  8. });

Text files should end with a newline character 11

  • Info
  • Codestyle

More information: https://insight.sensiolabs.com/what-we-analyse/missing_e_o_l

  1. public function getEnv($variable)
  2. {
  3. return env($variable);
  4. }
  5. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. public function book(Request $request)
  2. {
  3. Mail::to('neilo2000@gmail.com')->send(new BookingForm($request));
  4. return view('contact');
  5. }
  6. }

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. <a href="/logout" class="nav-link">Logout</a>
  2. </li>
  3. </ul>
  4. </div>
  5. </div>
  6. </nav><!-- end nav -->

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. </div>
  2. </div>
  3. </div>
  4. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. accessToken: '{{ get_env("MAPBOX_ACCESS_TOKEN") }}'
  2. }).addTo(mymap);
  3. var marker = L.marker([53.401472, -6.257827]).addTo(mymap);
  4. marker.bindPopup("<b>Hey!</b><br>Im right here.<br>In Northwood Gym").openPopup();
  5. </script>
  6. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. </div>
  2. </div>
  3. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. </div>
  2. </div>
  3. </div>
  4. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. <h1>Phil Dillon Fitness Booking Form</h1>
  2. <p>Kudos! You have a new message from {{ request.name }}</p>
  3. <p>I want the {{ request.date }}</p>
  4. <p>{{ request.message }}</p>

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. {#<div class="copyright">A SolidSites website</div>#}
  2. </div>
  3. </div>
  4. </div>
  5. </footer><!-- end footer -->

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. </div>
  2. </div>
  3. </div>
  4. </div><!-- end profile modal -->
  5. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil
  1. </div>
  2. </div>
  3. </div>
  4. {% endblock %}

    This file ends with no newline character. It won't render properly on a terminal, and it's considered a bad practice. Add a simple line feed as the last character to fix it.

    Time to fix: about 15 minutes
    Open Issue Permalink
    Last edited by studentneil

.htaccess should be avoided

  • Info
  • Performance

More information: https://insight.sensiolabs.com/what-we-analyse/web.apache_config

A .htaccess file has been spotted. You should consider moving it to the server configuration to improve global performances.

Time to fix: about 1 hour
Open Issue Permalink
Last edited by studentneil