Showing 226 of 573 total issues
Method hydrate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function hydrate(PostComment ...$comment): void
{
$this->_em->createQueryBuilder()
->select('PARTIAL c.{id}')
->addSelect('u')
Method buildForm
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
->add('query', TextType::class, [
'attr' => [
Method __invoke
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'Returns a paginated list of entries from a specific user',
content: new OA\JsonContent(
type: 'object',
Method __invoke
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'Returns a paginated list of Entries',
content: new OA\JsonContent(
type: 'object',
Method __invoke
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'Returns a paginated list of comments from a specific user',
content: new OA\JsonContent(
type: 'object',
Method subscribed
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'A paginated list of posts from user\'s subscribed magazines',
content: new OA\JsonContent(
type: 'object',
Method __invoke
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'A paginated list of posts from the user',
content: new OA\JsonContent(
type: 'object',
Method __invoke
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'Returns a paginated list of entries from a specific domain',
content: new OA\JsonContent(
type: 'object',
Method favourited
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'A paginated list of user\'s favourited posts',
content: new OA\JsonContent(
type: 'object',
Consider simplifying this complex logical expression. Open
if ($parent instanceof Entry) {
$children = array_filter(
$comments,
fn ($val) => $val instanceof EntryComment && $val->entry === $parent
);
Method __invoke
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
ClientManagerInterface $manager,
ClientFactory $clientFactory,
UserCreate $userCreate,
UserRepository $userRepository,
SettingsManager $settingsManager,
Function handleImages
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function handleImages(array $attachment): ?Image
{
$images = array_filter(
$attachment,
fn ($val) => \in_array($val['type'], ['Document', 'Image']) && ImageManager::isImageUrl($val['url'])
- 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 notification
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
notification(data) {
if (data.detail.parentSubject && this.element.id === data.detail.parentSubject.htmlId) {
if (data.detail.op.endsWith('CommentDeletedNotification') || data.detail.op.endsWith('CommentCreatedNotification')) {
this.updateCommentCounter(data);
}
- 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 uploadImage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
#[OA\Response(
response: 201,
description: 'Returns the created oauth2 client. Be sure to save the identifier and secret since these will be how you obtain tokens for the API.',
content: new Model(type: OAuth2ClientDto::class, groups: ['Default', 'created', 'common']),
headers: [
- 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 __invoke
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
#[OA\Response(
response: 200,
description: 'Returns a paginated list of content, along with any ActivityPub actors that matched the query by username, or ActivityPub objects that matched the query by URL. Actors and objects are not paginated',
content: new OA\JsonContent(
type: 'object',
- 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 __invoke
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
#[OA\Response(
response: 201,
description: 'Returns the created oauth2 client. Be sure to save the identifier and secret since these will be how you obtain tokens for the API.',
content: new Model(type: OAuth2ClientDto::class, groups: ['created', 'common']),
headers: [
- 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 serializeNotification
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function serializeNotification(Notification $dto)
{
$toReturn = [
'notificationId' => $dto->getId(),
'status' => $dto->status,
- 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 ban
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
#[MapEntity(id: 'magazine_id')]
Magazine $magazine,
#[MapEntity(id: 'user_id')]
User $user,
MagazineBan $magazineBan,
Method create
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function create(int $id, string $filePath, int $width = null, int $height = null, string $altText = null, string $sourceUrl = null, string $storageUrl = null): self
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
private string $route,
private string $paramName,
private string $slug,
string $label,
string $title,