warlof/seat-migrator

View on GitHub

Showing 40 of 52 total issues

File alliances.php has 545 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return [
    101677770,
    117383987,
Severity: Major
Found in src/Config/alliances.php - About 1 day to fix

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

        public function handle()
        {
            $this->promptSetup();
            $this->backups();
    
    
    Severity: Major
    Found in src/Commands/Upgrade.php - About 3 hrs to fix

      Method getUpgradeMapping has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getUpgradeMapping(): array
          {
              return [
                  'character_infos'       => [
                      'characterID'    => 'character_id',
      Severity: Major
      Found in src/Models/CharacterSheet.php - About 2 hrs to fix

        Method upgrade has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function upgrade(string $target)
            {
                if (self::$alliance_ids == [])
                    self::$alliance_ids = include __DIR__ . '/../Config/alliances.php';
        
        
        Severity: Minor
        Found in src/Models/MailHeader.php - About 1 hr to fix

          Method getUpgradeMapping has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getUpgradeMapping(): array
              {
                  return [
                      'character_planet_pins' => [
                          'ownerID'        => 'character_id',
          Severity: Minor
          Found in src/Models/CharacterPlanetPin.php - About 1 hr to fix

            Method getUpgradeMapping has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getUpgradeMapping(): array
                {
                    return [
                        'character_killmails' => [
                            'characterID' => 'character_id',
            Severity: Minor
            Found in src/Models/Killmail.php - About 1 hr to fix

              Method getUpgradeMapping has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getUpgradeMapping(): array
                  {
                      return [
                          'corporation_member_trackings' => [
                              'corporationID'  => 'corporation_id',
              Severity: Minor
              Found in src/Models/CorporationMemberTracking.php - About 1 hr to fix

                Method getUpgradeMapping has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getUpgradeMapping(): array
                    {
                        return [
                            'contract_details' => [
                                'contractID'      => 'contract_id',
                Severity: Minor
                Found in src/Models/CharacterContract.php - About 1 hr to fix

                  Method getUpgradeMapping has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getUpgradeMapping(): array
                      {
                          return [
                              'contract_details' => [
                                  'contractID'     => 'contract_id',
                  Severity: Minor
                  Found in src/Models/CorporationContract.php - About 1 hr to fix

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

                        public function getUpgradeMapping(): array
                        {
                            return [
                                'character_calendar_event_details' => [
                                    'eventID'     => 'event_id',
                    Severity: Minor
                    Found in src/Models/CharacterCalendarEventDetail.php - About 1 hr to fix

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

                          public function getUpgradeMapping(): array
                          {
                              return [
                                  'corporation_industry_jobs' => [
                                      'corporationID'        => 'corporation_id',
                      Severity: Minor
                      Found in src/Models/CorporationIndustryJob.php - About 1 hr to fix

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

                            public function getUpgradeMapping(): array
                            {
                                return [
                                    'corporation_bookmarks' => [
                                        'corporationID' => 'corporation_id',
                        Severity: Minor
                        Found in src/Models/CorporationBookmark.php - About 1 hr to fix

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

                              public function getUpgradeMapping(): array
                              {
                                  return [
                                      'character_industry_jobs' => [
                                          'characterID'          => 'character_id',
                          Severity: Minor
                          Found in src/Models/CharacterIndustryJob.php - About 1 hr to fix

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

                                public function getUpgradeMapping() : array
                                {
                                    return [
                                        'character_bookmarks' => [
                                            'characterID' => 'character_id',
                            Severity: Minor
                            Found in src/Models/CharacterBookmark.php - About 1 hr to fix

                              Function getSenderTypeAttribute has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function getSenderTypeAttribute()
                                  {
                                      if ((3000000 <= $this->senderID && $this->senderID <= 4000000) ||
                                          (90000000 <= $this->senderID && $this->senderID <= 98000000))
                                          return 'character';
                              Severity: Minor
                              Found in src/Models/CharacterNotification.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 getUpgradeMapping has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function getUpgradeMapping(): array
                                  {
                                      return [
                                          'corporation_issued_medals' => [
                                              'corporationID' => 'corporation_id',
                              Severity: Minor
                              Found in src/Models/CorporationIssuedMedal.php - About 1 hr to fix

                                Function upgrade has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function upgrade(string $target)
                                    {
                                        if (self::$alliance_ids == [])
                                            self::$alliance_ids = include __DIR__ . '/../Config/alliances.php';
                                
                                
                                Severity: Minor
                                Found in src/Models/MailHeader.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 getRaceAttribute has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function getRaceAttribute($value)
                                    {
                                        if ($value == 'Gallente')
                                            return 8;
                                
                                
                                Severity: Minor
                                Found in src/Models/CharacterSheet.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 getStatusAttribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function getStatusAttribute($value)
                                    {
                                        if ($value == 'Completed')
                                            return 'finished';
                                
                                
                                Severity: Minor
                                Found in src/Models/CharacterContract.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

                                Avoid too many return statements within this method.
                                Open

                                            return 'cancelled';
                                Severity: Major
                                Found in src/Models/CorporationIndustryJob.php - About 30 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language