Showing 479 of 479 total issues

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

    public function apply($query)
    {
        // extract querying table (from)
        $table = $query->getQuery()->from;

Severity: Minor
Found in src/Http/DataTables/Scopes/AllianceScope.php - About 1 hr to fix

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

        public function handle()
        {
    
            $this->line('SeAT Admin Login URL Generator');
    
    
    Severity: Minor
    Found in src/Commands/Seat/Admin/Login.php - About 1 hr to fix

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

              return CharacterWalletJournal::select('first_party_id', 'second_party_id', 'ref_type', 'category', 'entity_id as party_id', 'name as party_name', DB::raw('count(*) as total'),
                  DB::raw("
                      CASE 
                          when universe_names.category = 'character' then 
                              (SELECT corporation_id FROM character_affiliations WHERE character_id = universe_names.entity_id) 
      Severity: Major
      Found in src/Http/Controllers/Character/IntelController.php and 1 other location - About 1 hr to fix
      src/Http/Controllers/Character/IntelController.php on lines 534..538

      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 103.

      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

                      CharacterWalletJournal::select('first_party_id', 'second_party_id', 'ref_type', 'category', 'entity_id as party_id', 'name as party_name', DB::raw('count(*) as total'), DB::raw("CASE when universe_names.category = 'character' then (SELECT corporation_id FROM character_affiliations WHERE character_id = universe_names.entity_id) when universe_names.category = 'corporation' then (SELECT corporation_id FROM character_affiliations WHERE corporation_id = universe_names.entity_id LIMIT 1) end AS corporation_id, CASE when universe_names.category = 'character' then (SELECT alliance_id FROM character_affiliations WHERE character_id = universe_names.entity_id) when universe_names.category = 'corporation' then (SELECT alliance_id FROM character_affiliations WHERE corporation_id = universe_names.entity_id LIMIT 1) end AS alliance_id, CASE when universe_names.category = 'character' then (SELECT faction_id FROM character_affiliations WHERE character_id = universe_names.entity_id) when universe_names.category = 'corporation' then (SELECT faction_id FROM character_affiliations WHERE corporation_id = universe_names.entity_id LIMIT 1) end AS faction_id"))
                          ->leftJoin('universe_names', 'universe_names.entity_id', '=', 'character_wallet_journals.second_party_id')
                          ->whereIn('character_wallet_journals.character_id', $character_ids->toArray())
                          ->whereNotIn('character_wallet_journals.second_party_id', $character_ids->toArray())
                          ->groupBy('first_party_id', 'second_party_id', 'ref_type', 'category', 'party_id', 'party_name')
      Severity: Major
      Found in src/Http/Controllers/Character/IntelController.php and 1 other location - About 1 hr to fix
      src/Http/Controllers/Character/IntelController.php on lines 507..532

      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 103.

      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

      Function _group has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          _group: function ( level, rows ) {
              var fns = $.isArray( this.c.dataSrc ) ? this.c.dataSrc : [ this.c.dataSrc ];
              var fn = DataTable.ext.oApi._fnGetObjectDataFn( fns[ level ] );
              var dt = this.s.dt;
              var group, last;
      Severity: Minor
      Found in src/resources/js/dataTables.rowGroup.js - About 1 hr to fix

        Method store has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function store(ProbeReport $request)
            {
                $report = $request->input('moon-report');
        
                // enforce tabulation spacer
        Severity: Minor
        Found in src/Http/Controllers/Tools/MoonsController.php - About 1 hr to fix

          Method characterTopMailInteractions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function characterTopMailInteractions(Collection $character_ids): Builder
              {
                  return MailHeader::select('from', 'entity_id as character_id', 'name as character_name', DB::raw('COUNT(*) as total'),
                      DB::raw("
                          CASE 
          Severity: Minor
          Found in src/Http/Controllers/Character/IntelController.php - About 1 hr to fix

            Method ajax has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function ajax()
                {
                    return datatables()
                        ->eloquent($this->applyScopes($this->query()))
                        ->editColumn('name', function ($row) {
            Severity: Minor
            Found in src/Http/DataTables/Alliance/Intel/TrackingDataTable.php - About 1 hr to fix

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

                  public function index(Request $request)
                  {
                      $squads = Squad::with('members', 'moderators', 'applications');
              
                      if ($request->has('filters')) {
              Severity: Minor
              Found in src/Http/Controllers/Squads/SquadsController.php - About 1 hr to fix

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

                    private function handleJobDispatch(Collection $job_classes, Request $request)
                    {
                        $job_classes->each(function ($class) use ($request) {
                
                            switch (true) {
                Severity: Minor
                Found in src/Http/Controllers/Tools/JobController.php - About 1 hr to fix

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

                      public function ajax()
                      {
                          return datatables()
                              ->eloquent($this->applyScopes($this->query()))
                              ->editColumn('name', function ($row) {
                  Severity: Minor
                  Found in src/Http/DataTables/Corporation/CorporationDataTable.php - About 1 hr to fix

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

                        private function characterTopWalletTransactionInteractions(Collection $character_ids): Builder
                        {
                    
                            return CharacterWalletTransaction::select('client_id', 'category', 'entity_id as party_id', 'name as party_name', DB::raw('count(*) as total'),
                                DB::raw("
                    Severity: Minor
                    Found in src/Http/Controllers/Character/IntelController.php - About 1 hr to fix

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

                          public function postUpdateSharelink(Sharelink $request)
                          {
                              // Validate our character id is valid for the submitting user
                              if ((int) $request->input('user_sharelink_character_id') !== 0) {
                                  $requested_character = auth()->user()->characters->contains((int) $request->input('user_sharelink_character_id'));
                      Severity: Minor
                      Found in src/Http/Controllers/Profile/ProfileController.php - About 1 hr to fix

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

                            private function addCorporationPermissionScope($query, string $ability)
                            {
                                if (auth()->user()->isAdmin())
                                    return $query;
                        
                        
                        Severity: Minor
                        Found in src/Http/Validation/StandingsExistingElementAdd.php - About 1 hr to fix

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

                              private function getStarbaseModules(int $corporation_id, int $starbase_id): Collection
                              {
                          
                                  // retrieving starbase location
                                  $starbase = CorporationStarbase::where('starbase_id', $starbase_id)
                          Severity: Minor
                          Found in src/Http/Controllers/Corporation/StarbaseController.php - About 1 hr to fix

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

                                public function getSystems(Request $request)
                                {
                                    if ($request->query('_type', 'query') == 'find') {
                                        $system = SolarSystem::find($request->query('q', 0));
                            
                            
                            Severity: Minor
                            Found in src/Http/Controllers/Support/FastLookupController.php - About 1 hr to fix

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

                                      return datatables()
                                          ->eloquent($this->applyScopes($this->query()))
                                          ->editColumn('timestamp', function ($row) {
                                              return view('web::partials.date', ['datetime' => $row->timestamp])->render();
                                          })
                              src/Http/DataTables/Character/Intel/CalendarDataTable.php on lines 43..53
                              src/Http/DataTables/Common/Intel/AbstractNoteDataTable.php on lines 41..49

                              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 102.

                              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

                                      return datatables()->eloquent($this->query())
                                          ->editColumn('users', function ($row) {
                                              return $row->users->filter(function ($user) { return $user->name !== 'admin'; })->count();
                                          })
                                          ->editColumn('permissions', function ($row) {
                              Severity: Major
                              Found in src/Http/DataTables/Configuration/RolesDataTable.php and 1 other location - About 1 hr to fix
                              src/Http/DataTables/Character/Intel/MailDataTable.php on lines 42..71

                              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 102.

                              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

                                      return datatables()
                                          ->eloquent($this->applyScopes($this->query()))
                                          ->editColumn('created_at', function ($row) {
                                              return view('web::partials.date', ['datetime' => $row->created])->render();
                                          })
                              Severity: Major
                              Found in src/Http/DataTables/Common/Intel/AbstractNoteDataTable.php and 2 other locations - About 1 hr to fix
                              src/Http/DataTables/Character/Intel/CalendarDataTable.php on lines 43..53
                              src/Http/DataTables/Character/Intel/NotificationDataTable.php on lines 42..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 102.

                              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

                                      return datatables()
                                          ->eloquent($this->applyScopes($this->query()))
                                          ->editColumn('event_date', function ($row) {
                                              return view('web::partials.date', ['datetime' => $row->event_date])->render();
                                          })
                              Severity: Major
                              Found in src/Http/DataTables/Character/Intel/CalendarDataTable.php and 2 other locations - About 1 hr to fix
                              src/Http/DataTables/Character/Intel/NotificationDataTable.php on lines 42..61
                              src/Http/DataTables/Common/Intel/AbstractNoteDataTable.php on lines 41..49

                              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 102.

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language