Function renameLocaleFolders
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
private function renameLocaleFolders($from_locale, $to_locale) {
if ($from_locale && $to_locale) {
$templates_dir = './templates';
$main_dir = './application/language/main';
- 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
File languages.php
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
if (!defined('BASEPATH')) {
exit('No direct script access allowed');
}
- Create a ticketCreate a ticket
Function createLanguageFolders
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function createLanguageFolders($lang) {
$templates_dir = './templates';
$main_dir = './application/language/main';
$modules_dir = './application/modules';
- 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 deleteLanguageFolders
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function deleteLanguageFolders($lang) {
$templates_dir = './templates';
$main_dir = './application/language/main';
$modules_dir = './application/modules';
- 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 getPoFileSettingsText
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPoFileSettingsText($lang = '', $type = '', $module = NULL) {
$content = b"\xEF\xBB\xBF" .
'msgid ""' . PHP_EOL .
'msgstr ""' . PHP_EOL .
- Create a ticketCreate a ticket
Function getPoFileSettingsText
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getPoFileSettingsText($lang = '', $type = '', $module = NULL) {
$content = b"\xEF\xBB\xBF" .
'msgid ""' . PHP_EOL .
'msgstr ""' . PHP_EOL .
- 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 renameLocaleFolders
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function renameLocaleFolders($from_locale, $to_locale) {
if ($from_locale && $to_locale) {
$templates_dir = './templates';
$main_dir = './application/language/main';
- Create a ticketCreate a ticket
Method createLanguageFolders
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createLanguageFolders($lang) {
$templates_dir = './templates';
$main_dir = './application/language/main';
$modules_dir = './application/modules';
- Create a ticketCreate a ticket
Function _get_lang_folders
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function _get_lang_folders() {
$new_arr = [];
if ($handle = opendir(APPPATH . 'language/')) {
- 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 delete
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function delete() {
//cp_check_perm('lang_delete');
//$id = $this->input->post('lang_id');
$id = $this->input->post('ids');
- Create a ticketCreate a ticket
Method deleteLanguageFolders
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function deleteLanguageFolders($lang) {
$templates_dir = './templates';
$main_dir = './application/language/main';
$modules_dir = './application/modules';
- Create a ticketCreate a ticket
Function delete
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function delete() {
//cp_check_perm('lang_delete');
//$id = $this->input->post('lang_id');
$id = $this->input->post('ids');
- 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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function update($lang_id) {
//cp_check_perm('lang_edit');
$this->form_validation->set_rules('lang_name', lang('Language', 'admin'), 'trim|required|min_length[1]|max_length[100]');
- 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"