warlof/seat-migrator

View on GitHub

Showing 52 of 52 total issues

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

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

<?php
/**
 * Created by PhpStorm.
 * User: Warlof Tutsimo
 * Date: 22/04/2018
Severity: Major
Found in src/Models/CorporationHangarDivision.php and 1 other location - About 1 hr to fix
src/Models/CorporationWalletDivision.php on lines 1..46

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

<?php
/**
 * Created by PhpStorm.
 * User: Warlof Tutsimo
 * Date: 22/04/2018
Severity: Major
Found in src/Models/CorporationWalletDivision.php and 1 other location - About 1 hr to fix
src/Models/CorporationHangarDivision.php on lines 1..46

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

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

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

                'corporation_bookmarks' => [
                    'corporationID' => 'corporation_id',
                    'folderID'      => 'folder_id',
                    'bookmarkID'    => 'bookmark_id',
                    'creatorID'     => 'creator_id',
    Severity: Minor
    Found in src/Models/CorporationBookmark.php and 1 other location - About 30 mins to fix
    src/Models/CharacterBookmark.php on lines 26..44

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

    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

                'character_bookmarks' => [
                    'characterID' => 'character_id',
                    'bookmarkID'  => 'bookmark_id',
                    'folderID'    => 'folder_id',
                    'created'     => 'created',
    Severity: Minor
    Found in src/Models/CharacterBookmark.php and 1 other location - About 30 mins to fix
    src/Models/CorporationBookmark.php on lines 20..38

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

    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

    Avoid too many return statements within this method.
    Open

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

      Avoid too many return statements within this method.
      Open

                  return 'finished_contractor';
      Severity: Major
      Found in src/Models/CharacterContract.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return 'rejected';
        Severity: Major
        Found in src/Models/CharacterContract.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return 32;
          Severity: Major
          Found in src/Models/CharacterSheet.php - About 30 mins to fix

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

            <?php
            /**
             * Created by PhpStorm.
             * User: Warlof Tutsimo
             * Date: 22/04/2018
            Severity: Minor
            Found in src/Models/CorporationStarbase.php and 1 other location - About 30 mins to fix
            src/Models/CharacterResearch.php on lines 1..38

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

            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

            Avoid too many return statements within this method.
            Open

                    return 'reverted';
            Severity: Major
            Found in src/Models/CharacterIndustryJob.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return 'character';
              Severity: Major
              Found in src/Models/CharacterCalendarEventDetail.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return 'cancelled';
                Severity: Major
                Found in src/Models/CharacterIndustryJob.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return 'reversed';
                  Severity: Major
                  Found in src/Models/CharacterContract.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return 0;
                    Severity: Major
                    Found in src/Models/CharacterSheet.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

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