Showing 318 of 14,363 total issues
Function validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function validate($value, Constraint $constraint)
{
if($value instanceof ContentTypeInterface) {
$fields = $value->getFields();
foreach ($fields as $key => $field) {
- 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 reorderNodes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function reorderNodes(array $orderedNodes, NodeInterface $parentNode)
{
foreach ($orderedNodes as $position => $nodeId) {
$nodeVersions = $this->nodeRepository->findByNodeAndSite($nodeId, $parentNode->getSiteId());
- 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 addWorkflowProfile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function addWorkflowProfile(GroupFormEvent $event)
{
$builder = $event->getBuilder();
$group = $builder->getData();
$configuration = array();
- 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 filterSearch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function filterSearch(PaginateFinderConfiguration $configuration, Stage $qa)
{
$qa->match(array('extra.site_id' => $configuration->getSearchIndex('site_id')));
$userName = $configuration->getSearchIndex('user_name');
- 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 method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return $this->canActOnSite($subject->getSite()->getSiteId(), $user);
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return false;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return $this->voteForUser($subject, $user);
- Create a ticketCreate a ticket
Function newAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function newAction(Request $request, $contentTypeId, $language)
{
$siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
$site = $this->get('open_orchestra_model.repository.site')->findOneBySiteId($siteId);
- 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 _generateListableColumn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_generateListableColumn() {
let columnsDefinition = [];
let defaultListable = this._contentType.get('default_listable');
let createdCell = {
'linked_to_site': BooleanFormatter.getType(),
- 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 _transformTransitions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_transformTransitions(workflowProfiles) {
let transitions = [];
for (let workflowProfile of workflowProfiles) {
if (workflowProfile.has('transitions')) {
for (let transition of workflowProfile.get('transitions').models) {
- 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 formAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function formAction(Request $request, $contentId, $language, $version)
{
$content = $this->get('open_orchestra_model.repository.content')->findOneByLanguageAndVersion($contentId, $language, $version);
if (!$content instanceof ContentInterface) {
throw new \UnexpectedValueException();
- 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 formAction
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function formAction(Request $request, $siteId, $nodeId, $language, $version)
{
$nodeRepository = $this->get('open_orchestra_model.repository.node');
if (null === $version) {
$node = $nodeRepository->findInLastVersion($nodeId, $language, $siteId);
- 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 _generateFieldColumn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_generateFieldColumn() {
let columnsDefinition = [];
let fields = this._contentType.get('fields');
if (typeof fields !== "undefined") {
for (let field of fields) {
- 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 _displayError
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_displayError(error) {
if (('ApiError' === error.name || 'ServerError' === error.name) && error.statusCode === 401) {
window.location.pathname = Routing.generate('fos_user_security_login', true);
} else {
let type = ('ApiError' === error.name) ? 'warning' : 'danger';
- 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 transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function transform($block, array $params = array())
{
if (!$block instanceof BlockInterface) {
throw new TransformerParameterTypeException();
}
- 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 displayUsedReferences
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function displayUsedReferences(SymfonyStyle $io, array $usedReferences)
{
foreach ($usedReferences as $usedReference) {
$entity = $usedReference['entity'];
$io->comment('Entity <info>'.$entity->getName(). ' is used in :');
- 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 transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function transform($site, array $params = array())
{
if (!$site instanceof SiteInterface) {
throw new TransformerParameterTypeException();
}
- 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 transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function transform($fieldOptions)
{
$result = array();
if (is_array($fieldOptions)) {
foreach ($fieldOptions as $fieldOption) {
- 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)) {
$element = $entity->getAttributes();
$contentIds = $this->extractContentsFromElement($element);
- 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"