seatplus/eveapi

View on GitHub

Showing 31 of 156 total issues

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

protected array $roles_array = [
'Account_Take_1', 'Account_Take_2', 'Account_Take_3', 'Account_Take_4', 'Account_Take_5', 'Account_Take_6',
'Account_Take_7', 'Accountant', 'Auditor', 'Communications_Officer', 'Config_Equipment', 'Config_Starbase_Equipment',
'Container_Take_1', 'Container_Take_2', 'Container_Take_3', 'Container_Take_4', 'Container_Take_5', 'Container_Take_6',
'Container_Take_7', 'Contract_Manager', 'Diplomat', 'Director', 'Factory_Manager', 'Fitting_Manager', 'Hangar_Query_1',
Severity: Major
Found in src/Models/Character/CharacterRole.php and 1 other location - About 3 hrs to fix
database/factories/CharacterRoleFactory.php on lines 36..45

The class CharacterInfo has 18 public methods. Consider refactoring CharacterInfo to keep number of public methods under 10.
Open

class CharacterInfo extends Model
{
use HasFactory;
 
protected $guarded = [];

File CheckJobsCommand.php has 277 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed

<?php
 
/*
* MIT License
*
Severity: Minor
Found in src/Commands/CheckJobsCommand.php - About 2 hrs to fix

    Avoid excessively long variable names like $unknown_constellation_ids. Keep variable name length under 20.
    Open

    $unknown_constellation_ids = System::whereDoesntHave('constellation')->pluck('constellation_id')->unique()->values();

    Function handleException has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    private function handleException(RequestFailedException $exception): void
    {
    // If error is in 4xx or 5xx range increase esi rate limit
    if (($exception->getOriginalException()->getCode() >= 400) && ($exception->getOriginalException()->getCode() <= 599)) {
    $this->incrementEsiRateLimit();
    Severity: Minor
    Found in src/Services/Esi/RetrieveEsiData.php - About 1 hr to fix

    Method persist has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Confirmed

    private function persist(Collection $contracts): void
    {
    Contract::upsert(
    $contracts->toArray(),
    ['contract_id'],
    Severity: Minor
    Found in src/Jobs/Contracts/CharacterContractsJob.php - About 1 hr to fix

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

      <?php
       
      /*
      * MIT License
      *
      src/Jobs/Hydrate/Maintenance/GetMissingCategorys.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingCharacterInfosFromCorporationMemberTracking.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingConstellations.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingGroups.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingRegions.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromCharacterAssets.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkillQueue.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkills.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromWalletTransaction.php on lines 1..50

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

      <?php
       
      /*
      * MIT License
      *
      src/Jobs/Hydrate/Maintenance/GetMissingCategorys.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingCharacterInfosFromCorporationMemberTracking.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingConstellations.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingGroups.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingRegions.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromContractItem.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkillQueue.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkills.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromWalletTransaction.php on lines 1..50

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

      <?php
       
      /*
      * MIT License
      *
      Severity: Major
      Found in src/Jobs/Hydrate/Maintenance/GetMissingGroups.php and 9 other locations - About 55 mins to fix
      src/Jobs/Hydrate/Maintenance/GetMissingCategorys.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingCharacterInfosFromCorporationMemberTracking.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingConstellations.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingRegions.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromCharacterAssets.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromContractItem.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkillQueue.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkills.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromWalletTransaction.php on lines 1..50

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

      <?php
       
      /*
      * MIT License
      *
      Severity: Major
      Found in src/Jobs/Hydrate/Maintenance/GetMissingConstellations.php and 9 other locations - About 55 mins to fix
      src/Jobs/Hydrate/Maintenance/GetMissingCategorys.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingCharacterInfosFromCorporationMemberTracking.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingGroups.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingRegions.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromCharacterAssets.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromContractItem.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkillQueue.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkills.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromWalletTransaction.php on lines 1..50

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

      <?php
       
      /*
      * MIT License
      *
      Severity: Major
      Found in src/Jobs/Hydrate/Maintenance/GetMissingCategorys.php and 9 other locations - About 55 mins to fix
      src/Jobs/Hydrate/Maintenance/GetMissingCharacterInfosFromCorporationMemberTracking.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingConstellations.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingGroups.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingRegions.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromCharacterAssets.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromContractItem.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkillQueue.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkills.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromWalletTransaction.php on lines 1..50

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

      <?php
       
      /*
      * MIT License
      *
      src/Jobs/Hydrate/Maintenance/GetMissingCategorys.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingCharacterInfosFromCorporationMemberTracking.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingConstellations.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingGroups.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingRegions.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromCharacterAssets.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromContractItem.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkillQueue.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkills.php on lines 1..50

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

      <?php
       
      /*
      * MIT License
      *
      Severity: Major
      Found in src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkillQueue.php and 9 other locations - About 55 mins to fix
      src/Jobs/Hydrate/Maintenance/GetMissingCategorys.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingCharacterInfosFromCorporationMemberTracking.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingConstellations.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingGroups.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingRegions.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromCharacterAssets.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromContractItem.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkills.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromWalletTransaction.php on lines 1..50

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

      <?php
       
      /*
      * MIT License
      *
      Severity: Major
      Found in src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkills.php and 9 other locations - About 55 mins to fix
      src/Jobs/Hydrate/Maintenance/GetMissingCategorys.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingCharacterInfosFromCorporationMemberTracking.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingConstellations.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingGroups.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingRegions.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromCharacterAssets.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromContractItem.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkillQueue.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromWalletTransaction.php on lines 1..50

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

      <?php
       
      /*
      * MIT License
      *
      Severity: Major
      Found in src/Jobs/Hydrate/Maintenance/GetMissingRegions.php and 9 other locations - About 55 mins to fix
      src/Jobs/Hydrate/Maintenance/GetMissingCategorys.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingCharacterInfosFromCorporationMemberTracking.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingConstellations.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingGroups.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromCharacterAssets.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromContractItem.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkillQueue.php on lines 1..51
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromSkills.php on lines 1..50
      src/Jobs/Hydrate/Maintenance/GetMissingTypesFromWalletTransaction.php on lines 1..50

      The class CharacterInfo has a coupling between objects value of 26. Consider to reduce the number of dependencies under 13.
      Open

      class CharacterInfo extends Model
      {
      use HasFactory;
       
      protected $guarded = [];

      The class MaintenanceJob has a coupling between objects value of 22. Consider to reduce the number of dependencies under 13.
      Open

      class MaintenanceJob implements ShouldQueue
      {
      use Batchable;
      use Dispatchable;
      use InteractsWithQueue;
      Severity: Minor
      Found in src/Jobs/Seatplus/MaintenanceJob.php by phpmd

      Function handle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Confirmed

      public function handle(int $location_id): void
      {
      $location = Location::with('locatable')->firstOrNew([
      'location_id' => $location_id,
      ]);
      Severity: Minor
      Found in src/Services/ResolveLocation/ResolveLocationService.php - About 35 mins to fix

      Function failed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Confirmed

      public function failed(Throwable $exception): void
      {
      if ($exception instanceof MaxAttemptsExceededException) {
      $this->delete();
      logger()->info('deleted job because MaxAttemptsException');
      Severity: Minor
      Found in src/Jobs/Universe/ResolveUniverseStructureByIdJob.php - About 35 mins to fix

      Missing class import via use statement (line '42', column '50').
      Open

      throw_unless(is_string($expression), new \Exception(sprintf('class %s could not be found in scheduled jobs', $scheduled_class)));
      Severity
      Category
      Status
      Source
      Language