imagecms/ImageCMS

View on GitHub
application/modules/CMSFactory/MetaManipulator/MetaManipulator.php

Summary

Maintainability
D
2 days
Test Coverage

MetaManipulator has 53 functions (exceeds 20 allowed). Consider refactoring.
Open

class MetaManipulator
{
    const META_TITLE = 1;
    const META_DESCRIPTION = 2;
    const META_KEYWORDS = 3;
Severity: Major
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 7 hrs to fix

File MetaManipulator.php has 370 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace CMSFactory\MetaManipulator;

use CI;
Severity: Minor
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 4 hrs to fix

Function getGrammensWord has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    private function getGrammensWord($paradigm, $param, $grammar = null) {

        $result = [];
        if ($grammar !== null) {

Severity: Minor
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 2 hrs 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 morphing has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    protected function morphing($string, $part) {

        $ucFirst = false;
        //check if first letter is uppercase
        if (mb_strtolower($string) !== $string) {
Severity: Minor
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 2 hrs 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 checkGrammar has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkGrammar($paradigm, $param, $word) {
        /** @var phpMorphy_WordForm_WordFormInterface $form */
        foreach ($paradigm as $form) {
            foreach ($form->getGrammems() as $grammatical) {
                switch ($grammatical) {
Severity: Minor
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 1 hr 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

Method morphing has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function morphing($string, $part) {

        $ucFirst = false;
        //check if first letter is uppercase
        if (mb_strtolower($string) !== $string) {
Severity: Minor
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 1 hr to fix

Function getTypeSpeechWord has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function getTypeSpeechWord($word, $param) {

        $typeSpeech = $this->getPhpMorphy()->getPartOfSpeech($word);
        foreach ($typeSpeech as $type) {
            $checkGrammar[$type] = $this->getPhpMorphy()->castFormByGramInfo($word, $type, [$param, 'ИМ'], true);
Severity: Minor
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 1 hr 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 render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function render() {

        $return = [];
        /** @var string $w wrapper */
        $w = $this->getWrapper();
Severity: Minor
Found in application/modules/CMSFactory/MetaManipulator/MetaManipulator.php - About 55 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

There are no issues that match your filters.

Category
Status