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'),
- Read upRead up
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([
- Read upRead up
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,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
UuidInterface $id,
UuidInterface $packageId,
\DateTimeImmutable $date,
string $version,
?string $ip = null,
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');
- Read upRead up
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,
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)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
PackageManager $packageManager,
PackageNormalizer $packageNormalizer,
PackageRepository $packageRepository,
Storage $distStorage,
UserOAuthTokenRefresher $tokenRefresher,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
UuidInterface $id,
string $version,
string $reference,
int $size,
\DateTimeImmutable $date,
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)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $region,
bool $isOpaqueAuth,
?string $key = null,
?string $secret = null,
?string $endpoint = null,
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
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
UuidInterface $id,
User $user,
string $type,
string $accessToken,
?string $refreshToken = null,
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)
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)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(array $emails, string $organizationAlias, string $packageName, string $packageId, array $result)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
\DateTimeImmutable $date,
Instance $instance,
array $organizations,
Downloads $downloads,
Proxy $proxy
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
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
SecurityChecker $checker,
PackageManager $packageManager,
ScanResultRepository $results,
MessageBusInterface $messageBus,
Storage $distStorage
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(string $id, string $name, string $alias, array $members, bool $hasAnonymousAccess)