teresko/palladium

View on GitHub

Showing 8 of 8 total issues

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

    private function fetchByIdentifier(Entity\StandardIdentity $entity)
    {
        $sql = "SELECT identity_id      AS id,
                       account_id       AS accountId,
                       hash             AS hash,
Severity: Major
Found in src/Palladium/Mapper/StandardIdentity.php and 1 other location - About 4 hrs to fix
src/Palladium/Mapper/Identity.php on lines 89..119

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

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

    private function fetchByToken(Entity\Identity $entity)
    {
        $sql = "SELECT identity_id      AS id,
                       parent_id        AS parentId,
                       account_id       AS accountId,
Severity: Major
Found in src/Palladium/Mapper/Identity.php and 1 other location - About 4 hrs to fix
src/Palladium/Mapper/StandardIdentity.php on lines 57..89

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

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

Collection has 28 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class Collection implements \Iterator, \ArrayAccess, \Countable
{

    abstract protected function buildEntity(): HasId;

Severity: Minor
Found in src/Palladium/Component/Collection.php - About 3 hrs to fix

    Identity has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Identity implements HasId
    {
    
        const TOKEN_SIZE = 16;
    
    
    Severity: Minor
    Found in src/Palladium/Entity/Identity.php - About 2 hrs to fix

      Identification has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Identification
      {
      
          const DEFAULT_COOKIE_LIFESPAN = 14400; // 4 hours
          const DEFAULT_TOKEN_LIFESPAN = 28800; // 8 hours
      Severity: Minor
      Found in src/Palladium/Service/Identification.php - About 2 hrs to fix

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

            public function findNonceIdentityByIdentifier(string $identifier): Entity\NonceIdentity
            {
                $identity = new Entity\NonceIdentity;
                $identity->setIdentifier($identifier);
        
        
        Severity: Minor
        Found in src/Palladium/Service/Search.php and 2 other locations - About 40 mins to fix
        src/Palladium/Service/Search.php on lines 64..82
        src/Palladium/Service/Search.php on lines 153..171

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

        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 3 locations. Consider refactoring.
        Open

            public function findStandardIdentityById(int $identityId): Entity\StandardIdentity
            {
                $identity = new Entity\StandardIdentity;
                $identity->setId($identityId);
        
        
        Severity: Minor
        Found in src/Palladium/Service/Search.php and 2 other locations - About 40 mins to fix
        src/Palladium/Service/Search.php on lines 64..82
        src/Palladium/Service/Search.php on lines 85..103

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

        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 3 locations. Consider refactoring.
        Open

            public function findStandardIdentityByIdentifier(string $identifier): Entity\StandardIdentity
            {
                $identity = new Entity\StandardIdentity;
                $identity->setIdentifier($identifier);
        
        
        Severity: Minor
        Found in src/Palladium/Service/Search.php and 2 other locations - About 40 mins to fix
        src/Palladium/Service/Search.php on lines 85..103
        src/Palladium/Service/Search.php on lines 153..171

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

        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

        Severity
        Category
        Status
        Source
        Language