Showing 85 of 140 total issues
File DbalPackageQuery.php
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Buddy\Repman\Query\User\PackageQuery;
Function synchronize
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function synchronize(Package $package): void
{
try {
$io = $this->createIO($package);
/** @var RepositoryInterface $repository */
- 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 synchronize
has 134 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function synchronize(Package $package): void
{
try {
$io = $this->createIO($package);
/** @var RepositoryInterface $repository */
Package
has 36 functions (exceeds 20 allowed). Consider refactoring. Open
class Package
{
public const NAME_PATTERN = '/^[a-z0-9]([_.-]?[a-z0-9]+)*\/[a-z0-9]([_.-]?[a-z0-9]+)*$/';
/**
File OrganizationController.php
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Buddy\Repman\Controller;
User
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class User
{
public const STATUS_ENABLED = 'enabled';
public const STATUS_DISABLED = 'disabled';
File PackageController.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Buddy\Repman\Controller\Api;
File Proxy.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Buddy\Repman\Service;
File PackageController.php
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare(strict_types=1);
namespace Buddy\Repman\Controller\Organization;
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,
Organization
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Organization
{
/**
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
Function voteOnAttribute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function voteOnAttribute(string $attribute, $subject, TokenInterface $token): bool
{
/**
* @var User
*/
- 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 packageNew
has 52 lines of code (exceeds 25 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'),
Method __construct
has 15 arguments (exceeds 4 allowed). Consider refactoring. Open
string $id,
string $organizationId,
string $type,
string $url,
?string $name = null,
Method buildForm
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('email', EmailType::class, [
'constraints' => [
Method buildForm
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('local_authentication', ChoiceType::class, [
'choices' => [
Function updateLatestProvider
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function updateLatestProvider(array $files): void
{
$latest = [];
foreach ($files as $file) {
\preg_match('/(?<name>.+)\$/', $file['filename'], $matches);
- 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 updateLatestProvider
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function updateLatestProvider(array $files): void
{
$latest = [];
foreach ($files as $file) {
\preg_match('/(?<name>.+)\$/', $file['filename'], $matches);
Method up
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up(Schema $schema): void
{
$this->abortIf(!$this->connection->getDatabasePlatform() instanceof PostgreSQLPlatform, 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE TABLE organization (id UUID NOT NULL, owner_id UUID NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, name VARCHAR(255) NOT NULL, alias VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
Method __construct
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
string $id,
string $organizationId,
string $url,
?string $name = null,
?string $latestReleasedVersion = null,