repman-io/repman

View on GitHub

Showing 140 of 140 total issues

Method distFilename has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function distFilename(string $organizationAlias, string $package, string $version, string $ref, string $format): Option
Severity: Minor
Found in src/Service/Organization/PackageManager.php - About 35 mins to fix

    Method sendScanResult has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function sendScanResult(array $emails, string $packageName, string $packageId, string $organizationAlias, array $result): void;
    Severity: Minor
    Found in src/Service/Mailer.php - About 35 mins to fix

      Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function __construct(string $id, int $tokens, bool $public, int $members, int $owners)
      Severity: Minor
      Found in src/Service/Telemetry/Entry/Organization.php - About 35 mins to fix

        Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function __construct(UuidInterface $id, Package $package, \DateTimeImmutable $date, string $status, array $content)
        Severity: Minor
        Found in src/Entity/Organization/Package/ScanResult.php - About 35 mins to fix

          Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function __construct(string $repo, string $package, string $version, string $ref, string $format)
          Severity: Minor
          Found in src/Service/Dist.php - About 35 mins to fix

            Method distribution has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public function distribution(string $package, string $version, string $ref, string $type, Request $request): Response
            Severity: Minor
            Found in src/Controller/ProxyController.php - About 35 mins to fix

              Method paginate has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  protected function paginate(callable $listFunction, int $total, int $perPage, int $page, string $baseUrl): array
              Severity: Minor
              Found in src/Controller/Api/ApiController.php - About 35 mins to fix

                Function __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function __construct(
                        string $region,
                        bool $isOpaqueAuth,
                        ?string $key = null,
                        ?string $secret = null,
                Severity: Minor
                Found in src/Service/Integration/Aws/S3AdapterFactory.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

                Function tryToRemoveWebhook has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function tryToRemoveWebhook(Package $package): ?string
                    {
                        $warning = null;
                        if ($package->getWebhookCreatedAt() !== null) {
                            try {
                Severity: Minor
                Found in src/Controller/Api/PackageController.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

                Function tryToRemoveWebhook has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function tryToRemoveWebhook(Package $package): void
                    {
                        if ($package->webhookCreatedAt() !== null) {
                            try {
                                switch ($package->type()) {
                Severity: Minor
                Found in src/Controller/OrganizationController.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 false;
                Severity: Major
                Found in src/Service/Organization/OrganizationVoter.php - About 30 mins to fix

                  Function handleAddPackage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function handleAddPackage(?string $type, FormInterface $form, Organization $organization, array $json): ?string
                      {
                          $id = null;
                  
                          switch ($type) {
                  Severity: Minor
                  Found in src/Controller/Api/PackageController.php - About 25 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 findProviders has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function findProviders(string $organizationAlias, array $packages): array
                      {
                          $data = [];
                          $lastModified = null;
                  
                  
                  Severity: Minor
                  Found in src/Service/Organization/PackageManager.php - About 25 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 diff has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function diff(Environment $env, $date, $now = null): string
                      {
                          $date = twig_date_converter($env, $date);
                  
                          $now = $now === null
                  Severity: Minor
                  Found in src/Service/Twig/DateExtension.php - About 25 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 loadREADME has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function loadREADME(Dist $dist): ?string
                      {
                          $tmpLocalFilename = $this->distStorage->getLocalFileForDist($dist);
                          if (null === $tmpLocalFilename->getOrNull()) {
                              return null;
                  Severity: Minor
                  Found in src/Service/ReadmeExtractor.php - About 25 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 checkPackage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function checkPackage(Package $package): array
                      {
                          $packageAdvisories = $this->advisories[$package->name()] ?? [];
                  
                          $alerts = [];
                  Severity: Minor
                  Found in src/Service/Security/SecurityChecker/SensioLabsSecurityChecker.php - About 25 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 changeRole has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function changeRole(User $user, string $role): void
                      {
                          if ($this->isLastOwner($user) && $role === Member::ROLE_MEMBER) {
                              throw new \RuntimeException('Organisation must have at least one owner.');
                          }
                  Severity: Minor
                  Found in src/Entity/Organization.php - About 25 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 execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function execute(InputInterface $input, OutputInterface $output): int
                      {
                          $limit = 100;
                          $count = $this->query->getAllSynchronizedCount();
                  
                  
                  Severity: Minor
                  Found in src/Command/ClearOldPrivateDistsCommand.php - About 25 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 accessToken has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function accessToken(UserOAuthTokenRefresher $tokenRefresher): string
                      {
                          if ($this->expiresAt !== null && (new \DateTimeImmutable()) > $this->expiresAt->modify('-1 min')) {
                              if ($this->refreshToken === null) {
                                  throw new \LogicException('Unable to refresh access token without refresh token');
                  Severity: Minor
                  Found in src/Entity/User/OAuthToken.php - About 25 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 scan has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function scan(Package $package): void
                      {
                          $packageName = $package->name();
                          $result = [];
                          $status = ScanResult::STATUS_OK;
                  Severity: Minor
                  Found in src/Service/Security/PackageScanner/SensioLabsPackageScanner.php - About 25 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

                  Severity
                  Category
                  Status
                  Source
                  Language