thomas-claireau/PHP-P6-Openclassrooms

View on GitHub

Showing 8 of 11 total issues

Method show has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function show(Figures $figure, string $slug, Request $request): Response
    {
        $user = $this->getUser();
        $comments = $this->commentRepository->findItems(1, $figure->getId());
        $nbGroups = round($this->commentRepository->countAll($figure->getId()) / 10);
Severity: Minor
Found in src/Controller/FigureController.php - About 1 hr to fix

    Method forgotPassword has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function forgotPassword(Request $request)
        {
            $user = new User();
            $form = $this->createForm(ForgotPasswordUserType::class, $user);
            $form->handleRequest($request);
    Severity: Minor
    Found in src/Controller/Security/SecurityController.php - About 1 hr to fix

      Method ajaxLoadItems has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function ajaxLoadItems(Request $request)
          {
              $params = $request->attributes->get('_route_params');
              $index = (int) $params['index'];
              $nbGroups = round($this->figuresRepository->countAll() / 15);
      Severity: Minor
      Found in src/Controller/HomeController.php - About 1 hr to fix

        Method ajaxLoadItems has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function ajaxLoadItems(Request $request)
            {
                $params = $request->attributes->get('_route_params');
                $index = (int) $params['index'];
                $idFigure = $params['id'];
        Severity: Minor
        Found in src/Controller/FigureController.php - About 1 hr to fix

          Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __construct(CategoryRepository $categoryRepository, PictureRepository $pictureRepository, VideoRepository $videoRepository, CommentRepository $commentRepository, FiguresRepository $figuresRepository, UserRepository $userRepository, UserPasswordEncoderInterface $encoder)
          Severity: Major
          Found in src/DataFixtures/FiguresFixtures.php - About 50 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                                if (allVideos && allVideos.length == 0) {
                                                    containerVideos.remove();
                                                }
            Severity: Major
            Found in assets/js/videos/videos.js - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                                  if (allPictures && allPictures.length == 0) {
                                                      containerPictures.remove();
                                                  }
              Severity: Major
              Found in assets/js/picture/picture.js - About 45 mins to fix

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

                    public function __construct(UserRepository $repository, ObjectManager $em, UserPasswordEncoderInterface $encoder, \Swift_Mailer $mailer, Environment $renderer)
                Severity: Minor
                Found in src/Controller/Security/SecurityController.php - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language