Showing 186 of 479 total issues

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 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 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 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 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 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 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 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 add_view_composers has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function add_view_composers()
                        {
                    
                            // User information view composer
                            $this->app['view']->composer([
                    Severity: Minor
                    Found in src/WebServiceProvider.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

                        Method rules has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function rules()
                            {
                        
                                // Start with a default rules array for the
                                // role_id check
                        Severity: Minor
                        Found in src/Http/Validation/RolePermission.php - About 1 hr to fix

                          Method register_policies has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function register_policies()
                              {
                                  $permissions = config('seat.permissions', []);
                          
                                  Gate::define('global.superuser', 'Seat\Web\Acl\Policies\GlobalPolicy@superuser');
                          Severity: Minor
                          Found in src/WebServiceProvider.php - About 1 hr to fix

                            Function draw has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function draw(Model $row)
                                {
                                    if ($row->location_type == 'station')
                                        return $row->station->name;
                            
                            
                            Severity: Minor
                            Found in src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php - About 55 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 postAddStandingsFromCorpOrChar has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function postAddStandingsFromCorpOrChar(StandingsExistingElementAdd $request)
                                {
                            
                                    // Get the standings profile that will be updated.
                                    $standings_profile = StandingsProfile::find($request->input('id'));
                            Severity: Minor
                            Found in src/Http/Controllers/Tools/StandingsController.php - About 55 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 checkLoginToken has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function checkLoginToken(string $token)
                                {
                                    // Fetch token from DB, if we can.
                                    $token = UserSharelink::find($token);
                            
                            
                            Severity: Minor
                            Found in src/Http/Controllers/Auth/SharelinkController.php - About 45 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 getEntities has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getEntities(Request $request)
                                {
                            
                                    $this->validate($request, [
                                        'type' => 'in:characters,corporations,alliances',
                            Severity: Minor
                            Found in src/Http/Controllers/Support/FastLookupController.php - About 45 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

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

                                private function getCorporationLedgerByMonth(int $corporation_id,
                                                                             string $group_field,
                                                                             array $ref_types,
                                                                             ?int $year = null,
                                                                             ?int $month = null): Collection
                            Severity: Minor
                            Found in src/Http/Controllers/Corporation/LedgerController.php - About 35 mins to fix

                              Function store has a Cognitive Complexity of 7 (exceeds 5 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 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 getStandingsAjaxElementName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getStandingsAjaxElementName(Request $request)
                                  {
                              
                                      $response = [
                                          'results' => [],
                              Severity: Minor
                              Found in src/Http/Controllers/Tools/StandingsController.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

                              Severity
                              Category
                              Status
                              Source
                              Language