repman-io/repman

View on GitHub

Showing 85 of 140 total issues

Function packageNew has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function packageNew(Organization $organization, Request $request, ?string $type): Response
    {
        $form = $this->createForm(AddPackageType::class);
        $form->get('formUrl')->setData($this->generateUrl(
            $request->attributes->get('_route'),
Severity: Minor
Found in src/Controller/Organization/PackageController.php - About 55 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 downloads has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function downloads(Request $request, Organization $organization): JsonResponse
    {
        $contents = json_decode($request->getContent(), true);
        if (!isset($contents['downloads']) || !is_array($contents['downloads']) || $contents['downloads'] === []) {
            return new JsonResponse([
Severity: Minor
Found in src/Controller/RepoController.php - About 55 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

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

        string $id,
        string $version,
        string $osVersion,
        string $phpVersion,
        int $users,
Severity: Major
Found in src/Service/Telemetry/Entry/Instance.php - About 50 mins to fix

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

            UuidInterface $id,
            UuidInterface $packageId,
            \DateTimeImmutable $date,
            string $version,
            ?string $ip = null,
    Severity: Minor
    Found in src/Entity/Organization/Package/Download.php - About 45 mins to fix

      Function getPackages has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private function getPackages(string $lockFile): array
          {
              $contents = json_decode($lockFile, true);
              if (json_last_error() !== JSON_ERROR_NONE) {
                  throw new \UnexpectedValueException('Invalid composer.lock');
      Severity: Minor
      Found in src/Service/Security/SecurityChecker/SensioLabsSecurityChecker.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

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

              string $id,
              string $userId,
              string $type,
              string $accessToken,
              ?string $refreshToken = null,
      Severity: Minor
      Found in src/Message/User/AddOAuthToken.php - About 45 mins to fix

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

            public function __construct(UuidInterface $id, string $type, string $url, array $metadata = [], int $keepLastReleases = 0, bool $enableSecurityScan = true)
        Severity: Minor
        Found in src/Entity/Organization/Package.php - About 45 mins to fix

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

                  PackageManager $packageManager,
                  PackageNormalizer $packageNormalizer,
                  PackageRepository $packageRepository,
                  Storage $distStorage,
                  UserOAuthTokenRefresher $tokenRefresher,
          Severity: Minor
          Found in src/Service/PackageSynchronizer/ComposerPackageSynchronizer.php - About 45 mins to fix

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

                    UuidInterface $id,
                    string $version,
                    string $reference,
                    int $size,
                    \DateTimeImmutable $date,
            Severity: Minor
            Found in src/Entity/Organization/Package/Version.php - About 45 mins to fix

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

                  public function __construct(string $id, string $organizationId, string $url, string $type = 'vcs', array $metadata = [], ?int $keepLastReleases = null)
              Severity: Minor
              Found in src/Message/Organization/AddPackage.php - About 45 mins to fix

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

                        string $region,
                        bool $isOpaqueAuth,
                        ?string $key = null,
                        ?string $secret = null,
                        ?string $endpoint = null,
                Severity: Minor
                Found in src/Service/Integration/Aws/S3AdapterFactory.php - About 45 mins to fix

                  Method syncSuccess has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function syncSuccess(string $name, string $description, string $latestReleasedVersion, array $encounteredVersions, array $encounteredLinks, \DateTimeImmutable $latestReleaseDate): void
                  Severity: Minor
                  Found in src/Entity/Organization/Package.php - About 45 mins to fix

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

                            UuidInterface $id,
                            User $user,
                            string $type,
                            string $accessToken,
                            ?string $refreshToken = null,
                    Severity: Minor
                    Found in src/Entity/User/OAuthToken.php - About 45 mins to fix

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

                          public function __construct(string $instanceIdFile, TelemetryQuery $query, Endpoint $endpoint, Config $config, MessageCountAwareInterface $failedTransport, ProxyRegister $proxies)
                      Severity: Minor
                      Found in src/Service/Telemetry.php - About 45 mins to fix

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

                            public function __construct(UuidInterface $id, string $email, string $emailConfirmToken, array $roles, ?string $timezone = null)
                        Severity: Minor
                        Found in src/Entity/User.php - About 35 mins to fix

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

                              public function __construct(array $emails, string $organizationAlias, string $packageName, string $packageId, array $result)
                          Severity: Minor
                          Found in src/Message/Security/SendScanResult.php - About 35 mins to fix

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

                                    \DateTimeImmutable $date,
                                    Instance $instance,
                                    array $organizations,
                                    Downloads $downloads,
                                    Proxy $proxy
                            Severity: Minor
                            Found in src/Service/Telemetry/Entry.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/SymfonyMailer.php - About 35 mins to fix

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

                                        SecurityChecker $checker,
                                        PackageManager $packageManager,
                                        ScanResultRepository $results,
                                        MessageBusInterface $messageBus,
                                        Storage $distStorage
                                Severity: Minor
                                Found in src/Service/Security/PackageScanner/SensioLabsPackageScanner.php - About 35 mins to fix

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

                                      public function __construct(string $id, string $name, string $alias, array $members, bool $hasAnonymousAccess)
                                  Severity: Minor
                                  Found in src/Query/User/Model/Organization.php - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language