Showing 67 of 89 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Filesystem $fileSystem,
MediaStorageManagerInterface $mediaStorageManager,
VideoManagerInterface $videoManager,
ImageManagerInterface $imageManager,
$tmpDir,
- Create a ticketCreate a ticket
Method cropAlternative
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function cropAlternative(MediaInterface $media, $x, $y, $h, $w, $formatName)
- Create a ticketCreate a ticket
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Filesystem $fileSystem,
MediaStorageManagerInterface $mediaStorageManager,
ImageManagerInterface $imageManager,
$tmpDir,
array $thumbnailFormat,
- Create a ticketCreate a ticket
Method cropAndResize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function cropAndResize($filePath, $x, $y, $h, $w, array $format);
- Create a ticketCreate a ticket
Method cropAndResize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function cropAndResize($filePath, $x, $y, $h, $w, array $format)
- Create a ticketCreate a ticket
Method generateMedia
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$fileName,
$folderReference,
$name,
array $keywordReferencesArray,
array $languagesArray
- Create a ticketCreate a ticket
Method generateFolder
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function generateFolder(array $names, $id, $folderId, $type, $siteId)
- Create a ticketCreate a ticket
Method checkRemoveReferencesToEntity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function checkRemoveReferencesToEntity($entity, $entityId, array $medias, $entityType, $itemRepository)
- Create a ticketCreate a ticket
Method checkAddReferencesToEntity
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function checkAddReferencesToEntity($entity, $entityId, array $medias, $entityType, $itemRepository)
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
FolderRepositoryInterface $folderRepository,
EventDispatcherInterface $eventDispatcher,
FolderEventFactory $folderEventFactory,
GroupRepositoryInterface $groupRepository,
SiteRepositoryInterface $siteRepository
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Filesystem $fileSystem,
MediaStorageManagerInterface $mediaStorageManager,
ImageManagerInterface $imageManager,
$tmpDir,
array $thumbnailFormat
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ContextBackOfficeInterface $currentSiteManager,
$mediaClass,
array $frontLanguages,
array $thumbnailConfig,
MediaStorageManagerInterface $storageManager
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$facadeClass = null,
FolderRepositoryInterface $folderRepository,
EventDispatcherInterface $eventDispatcher,
FolderEventFactory $folderEventFactory,
MultiLanguagesChoiceManagerInterface $multiLanguageChoiceManager
- Create a ticketCreate a ticket
Function isInPerimeter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function isInPerimeter($item, PerimeterInterface $perimeter)
{
if ($perimeter->getType() == $this->getType() && is_string($item)) {
foreach ($perimeter->getItems() as $path) {
if (0 === strpos($item, $path)) {
- Read upRead up
- Create a ticketCreate a ticket
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 function. Open
return seconds + ' second' + this._numberEnding(seconds)
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return $this->voteForSomeoneElseSubject($attribute, $subject, $token);
- Create a ticketCreate a ticket
Function _hasPerimeter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_hasPerimeter(foldersTree) {
for (let i = 0; i < foldersTree.length; i++) {
if (foldersTree[i].get('folder').get('rights').can_create_media) {
return true;
}
- Read upRead up
- Create a ticketCreate a ticket
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 addReferencesToEntity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function addReferencesToEntity($entity)
{
if ($this->support($entity)) {
$mediaIds = $this->extractMediasFromElement($entity->getAttributes());
- Read upRead up
- Create a ticketCreate a ticket
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 preSetData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function preSetData(FormEvent $event)
{
if ($event->getData() instanceof SiteInterface) {
$currentSiteId = $event->getData()->getSiteId();
$choices = $this->getChoices($currentSiteId);
- Read upRead up
- Create a ticketCreate a ticket
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 extractMediasFromElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function extractMediasFromElement($element)
{
$references = array();
if ($this->isMediaAttribute($element)) {
$references[] = $element['id'];
- Read upRead up
- Create a ticketCreate a ticket
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"