Showing 186 of 479 total issues

Method data has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function data()
    {
        return datatables()
            ->eloquent($this->applyScopes($this->query()))
            ->editColumn('date', function ($row) {
Severity: Minor
Found in src/Http/DataTables/Common/Industrial/AbstractMiningDataTable.php - About 1 hr to fix

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

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

      Method getJournalGraphBalance has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getJournalGraphBalance(CharacterInfo $character)
          {
      
              $data = CharacterWalletJournal::with('first_party', 'second_party')
                  ->where('character_id', $character->character_id)
      Severity: Minor
      Found in src/Http/Controllers/Character/WalletController.php - About 1 hr to fix

        Method getTopMailFromData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getTopMailFromData(CharacterInfo $character)
            {
        
                if (! request()->has('characters'))
                    return abort(500);
        Severity: Minor
        Found in src/Http/Controllers/Character/IntelController.php - About 1 hr to fix

          Method applyRules has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function applyRules(Builder $query, string $group_verb, $rules)
              {
                  $query_operator = $group_verb == 'whereHas' ? 'where' : 'orWhere';
          
                  if (is_array($rules))
          Severity: Minor
          Found in src/Models/Filterable.php - About 1 hr to fix

            Function getLocationNameFromDivision has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                private function getLocationNameFromDivision(CorporationAsset $item)
                {
                    // item > division > office > station / structure
                    if (in_array($item->container->location_flag, ['Impounded', 'OfficeFolder'])) {
                        if ($item->container->location_type == 'station')
            Severity: Minor
            Found in src/Http/DataTables/Corporation/Intel/Assets/Columns/Station.php - About 1 hr 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 getChangelogFromApi has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function getChangelogFromApi(string $uri, string $body_attribute, string $tag_attribute): string
                {
                    try {
                        return cache()->remember($this->getChangelogCacheKey($uri), 30, function () use ($uri, $body_attribute, $tag_attribute) {
                            $changelog = '';
            Severity: Minor
            Found in src/Http/Controllers/Configuration/SeatController.php - About 1 hr to fix

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

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

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

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

                  Function unveil has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    $.fn.unveil = function(threshold, callback) {
                  
                      var $w = $(window),
                          th = threshold || 0,
                          retina = window.devicePixelRatio > 1,
                  Severity: Minor
                  Found in src/resources/js/jquery.unveil.js - About 1 hr to fix

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

                        public function ajax()
                        {
                            return datatables()
                                ->eloquent($this->query())
                                ->addColumn('characters', function ($row) {
                    Severity: Minor
                    Found in src/Http/DataTables/Squads/MembersDataTable.php - About 1 hr to fix

                      Method getMoonIndicatorsAttribute has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getMoonIndicatorsAttribute()
                          {
                              if (is_null($this->moon_indicators)) {
                                  $this->moon_indicators = (object) [
                                      'ubiquitous' => $this->content->filter(function ($type) {
                      Severity: Minor
                      Found in src/Models/UniverseMoonReport.php - About 1 hr to fix

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

                            private function findOrCreateUser(SocialiteUser $eve_user): User
                            {
                        
                                // remove all existing tokens with a different hash.
                                // in case a hash has been altered, it might be because
                        Severity: Minor
                        Found in src/Http/Controllers/Auth/SsoController.php - About 1 hr to fix

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

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

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

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

                              Method ajax has 29 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/Character/CharacterDataTable.php - About 1 hr to fix

                                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

                                    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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language