repman-io/repman

View on GitHub

Showing 140 of 140 total issues

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

<?php

declare(strict_types=1);

namespace Buddy\Repman\Query\User\Model;
Severity: Major
Found in src/Query/User/Model/ApiToken.php and 1 other location - About 3 hrs to fix
src/Query/User/Model/Organization/Token.php on lines 1..41

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

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

declare(strict_types=1);

namespace Buddy\Repman\Service\Integration\BitbucketApi;
Severity: Major
Found in src/Service/Integration/BitbucketApi/Repositories.php and 1 other location - About 3 hrs to fix
src/Service/Integration/GitLabApi/Projects.php on lines 1..45

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

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

declare(strict_types=1);

namespace Buddy\Repman\Query\User\Model\Organization;
Severity: Major
Found in src/Query/User/Model/Organization/Token.php and 1 other location - About 3 hrs to fix
src/Query/User/Model/ApiToken.php on lines 1..41

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

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

File OrganizationController.php has 286 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);

namespace Buddy\Repman\Controller;
Severity: Minor
Found in src/Controller/OrganizationController.php - About 2 hrs to fix

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

    class User
    {
        public const STATUS_ENABLED = 'enabled';
    
        public const STATUS_DISABLED = 'disabled';
    Severity: Minor
    Found in src/Entity/User.php - About 2 hrs to fix

      File PackageController.php has 279 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      declare(strict_types=1);
      
      namespace Buddy\Repman\Controller\Api;
      Severity: Minor
      Found in src/Controller/Api/PackageController.php - About 2 hrs to fix

        File Proxy.php has 272 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        declare(strict_types=1);
        
        namespace Buddy\Repman\Service;
        Severity: Minor
        Found in src/Service/Proxy.php - About 2 hrs to fix

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

          <?php
          
          declare(strict_types=1);
          
          namespace Buddy\Repman\Migrations;
          Severity: Major
          Found in src/Migrations/Version20200713195731.php and 1 other location - About 2 hrs to fix
          src/Migrations/Version20200615181216.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 131.

          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
          
          declare(strict_types=1);
          
          namespace Buddy\Repman\Migrations;
          Severity: Major
          Found in src/Migrations/Version20200615181216.php and 1 other location - About 2 hrs to fix
          src/Migrations/Version20200713195731.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 131.

          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

              public function packages(Organization $organization, Request $request): JsonResponse
              {
                  return $this->json(
                      new Packages(...$this->paginate(
                          fn ($perPage, $offset) => $this->packageQuery->findAll($organization->id(), $perPage, $offset),
          Severity: Major
          Found in src/Controller/Api/PackageController.php and 1 other location - About 2 hrs to fix
          src/Controller/Api/TokenController.php on lines 66..79

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

          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

              public function tokens(Organization $organization, Request $request): JsonResponse
              {
                  return $this->json(
                      new Tokens(...$this->paginate(
                          fn ($perPage, $offset) => $this->organizationQuery->findAllTokens($organization->id(), $perPage, $offset),
          Severity: Major
          Found in src/Controller/Api/TokenController.php and 1 other location - About 2 hrs to fix
          src/Controller/Api/PackageController.php on lines 90..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 130.

          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

          <?php
          
          declare(strict_types=1);
          
          namespace Buddy\Repman\MessageHandler\Organization\Package;
          src/MessageHandler/Organization/Package/RemoveBitbucketHookHandler.php on lines 1..24
          src/MessageHandler/Organization/Package/RemoveGitHubHookHandler.php on lines 1..26

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

          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

          <?php
          
          declare(strict_types=1);
          
          namespace Buddy\Repman\MessageHandler\Organization\Package;
          src/MessageHandler/Organization/Package/RemoveBitbucketHookHandler.php on lines 1..24
          src/MessageHandler/Organization/Package/RemoveGitLabHookHandler.php on lines 1..24

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

          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

          <?php
          
          declare(strict_types=1);
          
          namespace Buddy\Repman\MessageHandler\Organization\Package;
          src/MessageHandler/Organization/Package/RemoveGitHubHookHandler.php on lines 1..26
          src/MessageHandler/Organization/Package/RemoveGitLabHookHandler.php on lines 1..24

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

          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

          File PackageController.php has 263 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          declare(strict_types=1);
          
          namespace Buddy\Repman\Controller\Organization;
          Severity: Minor
          Found in src/Controller/Organization/PackageController.php - About 2 hrs to fix

            Method findAll has 55 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function findAll(string $organizationId, Filter $filter): array
                {
                    $filterSQL = $joinSQL = '';
                    $params = [
                        'organization_id' => $organizationId,
            Severity: Major
            Found in src/Query/User/PackageQuery/DbalPackageQuery.php - About 2 hrs to fix

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

              class Organization
              {
                  /**
                   * @ORM\Id
                   * @ORM\Column(type="uuid", unique=true)
              Severity: Minor
              Found in src/Entity/Organization.php - About 2 hrs to fix

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

                <?php
                
                declare(strict_types=1);
                
                namespace Buddy\Repman\MessageHandler\Organization;
                Severity: Major
                Found in src/MessageHandler/Organization/GenerateTokenHandler.php and 1 other location - About 2 hrs to fix
                src/MessageHandler/User/GenerateApiTokenHandler.php on lines 1..35

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

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

                <?php
                
                declare(strict_types=1);
                
                namespace Buddy\Repman\Security\Model\User;
                Severity: Major
                Found in src/Security/Model/User/Organization.php and 4 other locations - About 2 hrs to fix
                src/Message/Organization/Member/InviteUser.php on lines 1..41
                src/Message/Organization/Package/Update.php on lines 1..41
                src/Query/Admin/Model/Organization.php on lines 1..41
                src/Query/Admin/Model/User.php on lines 1..51

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

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

                <?php
                
                declare(strict_types=1);
                
                namespace Buddy\Repman\Message\Organization\Member;
                Severity: Major
                Found in src/Message/Organization/Member/InviteUser.php and 4 other locations - About 2 hrs to fix
                src/Message/Organization/Package/Update.php on lines 1..41
                src/Query/Admin/Model/Organization.php on lines 1..41
                src/Query/Admin/Model/User.php on lines 1..51
                src/Security/Model/User/Organization.php on lines 1..41

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

                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