visavi/rotor

View on GitHub

Showing 512 of 512 total issues

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

    public function editPost(int $id, Request $request, Validator $validator)
    {
        $page = int($request->input('page'));

        if (! $user = getUser()) {
Severity: Minor
Found in app/Http/Controllers/Forum/TopicController.php - About 1 hr to fix

    Method index has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function index(Request $request, Validator $validator)
        {
            $type = $this->type;
    
            if ($request->isMethod('post')) {
    Severity: Minor
    Found in app/Http/Controllers/Admin/BlacklistController.php - About 1 hr to fix

      Method index has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function index(Request $request, Validator $validator)
          {
              if ($request->isMethod('post')) {
                  $message = $request->input('message');
                  $name = $request->input('name');
      Severity: Minor
      Found in app/Http/Controllers/MailController.php - About 1 hr to fix

        Method talk has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function talk(string $login): View
            {
                if (is_numeric($login)) {
                    $user = new User();
                    $user->id = $login;
        Severity: Minor
        Found in app/Http/Controllers/MessageController.php - About 1 hr to fix

          Method changeMail has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function changeMail(Request $request, Validator $validator): RedirectResponse
              {
                  if (! $user = getUser()) {
                      abort(403, __('main.not_authorized'));
                  }
          Severity: Minor
          Found in app/Http/Controllers/User/UserController.php - About 1 hr to fix

            Method comments has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function comments(int $id, Request $request, Validator $validator, Flood $flood)
                {
                    /** @var Offer $offer */
                    $offer = Offer::query()->find($id);
            
            
            Severity: Minor
            Found in app/Http/Controllers/OfferController.php - About 1 hr to fix

              Method deleteFile has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function deleteFile(Request $request, Validator $validator): JsonResponse
                  {
                      $types = [
                          Article::$morphName,
                          Item::$morphName,
              Severity: Minor
              Found in app/Http/Controllers/AjaxController.php - About 1 hr to fix

                Method install has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function install(Request $request): RedirectResponse
                    {
                        $moduleName = $request->input('module');
                        $enable = int($request->input('enable'));
                        $update = int($request->input('update'));
                Severity: Minor
                Found in app/Http/Controllers/Admin/ModuleController.php - About 1 hr to fix

                  Method editTopic has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function editTopic(int $id, Request $request, Validator $validator)
                      {
                          /** @var Topic $topic */
                          $topic = Topic::query()->find($id);
                  
                  
                  Severity: Minor
                  Found in app/Http/Controllers/Admin/ForumController.php - About 1 hr to fix

                    Method comments has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function comments(int $id, Request $request, Validator $validator, Flood $flood): View|RedirectResponse
                        {
                            /** @var Article $article */
                            $article = Article::query()->find($id);
                    
                    
                    Severity: Minor
                    Found in app/Http/Controllers/ArticleController.php - About 1 hr to fix

                      Method edit has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function edit(int $id, Request $request, Validator $validator)
                          {
                              if (! $user = getUser()) {
                                  abort(403, __('main.not_authorized'));
                              }
                      Severity: Minor
                      Found in app/Http/Controllers/OfferController.php - About 1 hr to fix

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                    foreach ($data as $val) {
                                        $name = check($val->name);
                        
                                        if ($val->color) {
                                            $name = '<span style="color:' . $val->color . '">' . $name . '</span>';
                        Severity: Major
                        Found in app/Models/Advert.php and 1 other location - About 1 hr to fix
                        app/Models/AdminAdvert.php on lines 47..61

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 110.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                        <?php
                        
                        return [
                            'photos'                 => 'Фото',
                            'albums'                 => 'Альбомы',
                        Severity: Major
                        Found in resources/lang/ru/photos.php and 2 other locations - About 1 hr to fix
                        resources/lang/en/photos.php on lines 1..25
                        resources/lang/ua/photos.php on lines 1..25

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 110.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                        <?php
                        
                        return [
                            'photos'                 => 'Фото',
                            'albums'                 => 'Альбоми',
                        Severity: Major
                        Found in resources/lang/ua/photos.php and 2 other locations - About 1 hr to fix
                        resources/lang/en/photos.php on lines 1..25
                        resources/lang/ru/photos.php on lines 1..25

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 110.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 2 locations. Consider refactoring.
                        Open

                                        foreach ($data as $val) {
                                            $name = check($val->name);
                        
                                            if ($val->color) {
                                                $name = '<span style="color:' . $val->color . '">' . $name . '</span>';
                        Severity: Major
                        Found in app/Models/AdminAdvert.php and 1 other location - About 1 hr to fix
                        app/Models/Advert.php on lines 52..66

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 110.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Similar blocks of code found in 3 locations. Consider refactoring.
                        Open

                        <?php
                        
                        return [
                            'photos'                 => 'A photo',
                            'albums'                 => 'Albums',
                        Severity: Major
                        Found in resources/lang/en/photos.php and 2 other locations - About 1 hr to fix
                        resources/lang/ru/photos.php on lines 1..25
                        resources/lang/ua/photos.php on lines 1..25

                        Duplicated Code

                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                        Tuning

                        This issue has a mass of 110.

                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                        Refactorings

                        Further Reading

                        Method index has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function index(Request $request, Validator $validator)
                            {
                                if ($request->isMethod('post')) {
                                    $msg = $request->input('msg');
                                    $type = int($request->input('type'));
                        Severity: Minor
                        Found in app/Http/Controllers/Admin/DeliveryController.php - About 1 hr to fix

                          Method edit has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function edit(int $id, Request $request, Validator $validator)
                              {
                                  if (! isAdmin(User::BOSS)) {
                                      abort(403, __('errors.forbidden'));
                                  }
                          Severity: Minor
                          Found in app/Http/Controllers/Admin/ForumController.php - About 1 hr to fix

                            Method create has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function create(string $login, Request $request, Validator $validator, Flood $flood): RedirectResponse
                                {
                                    if (! getUser()) {
                                        abort(403, __('main.not_authorized'));
                                    }
                            Severity: Minor
                            Found in app/Http/Controllers/WallController.php - About 1 hr to fix

                              Method editComment has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function editComment(int $id, int $cid, Request $request, Validator $validator): View|RedirectResponse
                                  {
                                      $down = Down::query()->find($id);
                              
                                      if (! $down) {
                              Severity: Minor
                              Found in app/Http/Controllers/Load/DownController.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language