Method get_language_names
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_language_names() {
$languageCodes = [
'ab' => lang('Abkhazian', 'translator', FALSE),
'ae' => lang('Avestan', 'translator', FALSE),
- Create a ticketCreate a ticket
Function makeCorrectUrl
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function makeCorrectUrl($from = '', $to = '') {
$dotsCount = substr_count($to, '..');
if (substr($from, -1) == '/') {
- 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 getEditorStyles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function getEditorStyles() {
$files = scandir(getModulePath('translator') . '/assets/js/src-min');
$styles = [];
foreach ($files 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 can_edit_file
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function can_edit_file($module_name, $entity_type) {
if (!MAINSITE) {
return 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 get_mainsite_url
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function get_mainsite_url($url) {
$true_path = preg_replace('/\/language(.*)/', '', $url);
if (strstr($true_path, './templates/')) {
- 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"