Function findLangs
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
public function findLangs($dir = '') {
if (!in_array($dir, self::$PARSED_PATHS)) {
$baseDir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
foreach ($baseDir as $file) {
- 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 getParsedPathsLangs
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getParsedPathsLangs($baseUrl, $paths = []) {
if ($paths) {
$result = [];
if ($paths) {
- 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 findLangs
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findLangs($dir = '') {
if (!in_array($dir, self::$PARSED_PATHS)) {
$baseDir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir));
foreach ($baseDir as $file) {
- Create a ticketCreate a ticket
Function parseTemplates
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function parseTemplates() {
try {
if (!is_dir(self::$TEMPLATES_PATH)) {
return [];
- 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 parseModules
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function parseModules() {
try {
$modules = getModulesPaths();
foreach ($modules as $moduleName => $modulePath) {
- 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 parseModules
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parseModules() {
try {
$modules = getModulesPaths();
foreach ($modules as $moduleName => $modulePath) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if ($lang) {
$lang = mb_ereg_search_getregs(); //get first result
do {
$origin = mb_ereg_replace('!\s+!', ' ', $lang[1]);
- Create a ticketCreate a ticket
Function parseMain
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function parseMain() {
try {
if (!is_dir(self::$MAIN_PATH)) {
return [];
- 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"