MetaManipulator
has 53 functions (exceeds 20 allowed). Consider refactoring. Open
class MetaManipulator
{
const META_TITLE = 1;
const META_DESCRIPTION = 2;
const META_KEYWORDS = 3;
- Create a ticketCreate a ticket
File MetaManipulator.php
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace CMSFactory\MetaManipulator;
use CI;
- Create a ticketCreate a ticket
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) {
- 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 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) {
- 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 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) {
- 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
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) {
- Create a ticketCreate a ticket
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);
- 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 render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function render() {
$return = [];
/** @var string $w wrapper */
$w = $this->getWrapper();
- 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"