open-orchestra/open-orchestra-media-admin-bundle

View on GitHub

Showing 67 of 89 total issues

Function _drawCallback has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    _drawCallback(settings)
    {
        let context = this;
        let $mediaList = $('<div></div>').addClass('well').data('context', this);
        let templateFile = (context._selectionMod) ? 'Media/Modal/mediaSelectCellView' : 'Media/mediaListCellView';

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 buildView has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $media = $form->getData();
        if (!empty($media->getAlternatives())) {
            $view->vars['alternatives'] = array(
Severity: Minor
Found in MediaAdminBundle/Form/Type/MediaImageType.php - About 25 mins to fix

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->extractMediasFromContent($entity);

Severity: Minor
Found in MediaAdmin/Reference/Strategies/MediaInContentReferenceStrategy.php - About 25 mins to fix

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->extractMediasFromContentType($entity);

Severity: Minor
Found in MediaAdmin/Reference/Strategies/MediaInContentTypeReferenceStrategy.php - About 25 mins to fix

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($mixed, array $params = array())
    {
        $facade = $this->newFacade();

        $facade->id = $mixed->getId();
Severity: Minor
Found in MediaAdminBundle/Transformer/MediaTransformer.php - About 25 mins to fix

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)) {
            $keywordIds = $this->extractKeywordsFromKeywordableEntity($entity);

Severity: Minor
Found in MediaAdmin/Reference/Strategies/KeywordInMediaReferenceStrategy.php - About 25 mins to fix

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 updatePath has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function updatePath(FolderEvent $event)
    {
        $folder = $event->getFolder();

        $parentFolder = $folder->getParent();
Severity: Minor
Found in MediaAdmin/EventSubscriber/FolderSubscriber.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language