File admin.php
has 635 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use CMSFactory\assetManager;
use translator\classes\PoFileManager;
use translator\classes\FileOperator;
- Create a ticketCreate a ticket
Function parse
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function parse($module_template, $type, $lang) {
$url_base = dirname($this->poFileManager->getPoFileUrl($module_template, $type, $lang));
$url = get_mainsite_url($url_base);
- 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 updateJsLangsFile
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function updateJsLangsFile($langs, $domain, $type) {
if ($type == 'modules') {
if (MAINSITE && !is_client_module($domain)) {
return FALSE;
- 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
Admin
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Admin extends BaseAdminController
{
private static $BILING;
- Create a ticketCreate a ticket
Function makeCorrectPoPaths
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function makeCorrectPoPaths($module_template, $type, $lang, $returnArray = FALSE) {
$url = dirname($this->poFileManager->getPoFileUrl($module_template, $type, $lang));
//______________________________________________________
$url = get_mainsite_url($url);
- 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 createFile
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function createFile($module_template, $type, $lang) {
if ($this->input->post()) {
$lang = $this->input->post('locale');
$type = $this->input->post('type');
- 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 search
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function search($search = NULL, $searchType = NULL) {
$data = $this->input->post();
$search = $search ?: trim($data['search']);
$search = urldecode($search);
- 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 translate
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function translate() {
$po_array = (array) json_decode($this->input->post('po_array'));
$result = (array) json_decode($this->input->post('results'));
$withEmptyTranslation = $this->input->post('withEmptyTranslation');
- 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 parse
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function parse($module_template, $type, $lang) {
$url_base = dirname($this->poFileManager->getPoFileUrl($module_template, $type, $lang));
$url = get_mainsite_url($url_base);
- Create a ticketCreate a ticket
Method search
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function search($search = NULL, $searchType = NULL) {
$data = $this->input->post();
$search = $search ?: trim($data['search']);
$search = urldecode($search);
- Create a ticketCreate a ticket
Method makeCorrectPoPaths
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeCorrectPoPaths($module_template, $type, $lang, $returnArray = FALSE) {
$url = dirname($this->poFileManager->getPoFileUrl($module_template, $type, $lang));
//______________________________________________________
$url = get_mainsite_url($url);
- Create a ticketCreate a ticket
Method createFile
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function createFile($module_template, $type, $lang) {
if ($this->input->post()) {
$lang = $this->input->post('locale');
$type = $this->input->post('type');
- Create a ticketCreate a ticket
Method index
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function index($isExchange = FALSE) {
$translation = $this->session->userdata('translation');
$po_table = '';
- Create a ticketCreate a ticket
Method exchangeTranslation
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exchangeTranslation() {
if ($this->input->post()) {
$langExchanger = $this->input->post('langExchanger');
$langReceiver = $this->input->post('langReceiver');
- Create a ticketCreate a ticket
Function exchangeTranslation
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function exchangeTranslation() {
if ($this->input->post()) {
$langExchanger = $this->input->post('langExchanger');
$langReceiver = $this->input->post('langReceiver');
- 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 updateJsLangsFile
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function updateJsLangsFile($langs, $domain, $type) {
if ($type == 'modules') {
if (MAINSITE && !is_client_module($domain)) {
return FALSE;
- Create a ticketCreate a ticket
Function index
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function index($isExchange = FALSE) {
$translation = $this->session->userdata('translation');
$po_table = '';
- 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 translate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function translate() {
$po_array = (array) json_decode($this->input->post('po_array'));
$result = (array) json_decode($this->input->post('results'));
$withEmptyTranslation = $this->input->post('withEmptyTranslation');
- Create a ticketCreate a ticket
Method renderModulePoFile
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderModulePoFile($module_template, $type, $lang) {
$this->session->unset_userdata('translation');
$url = $this->poFileManager->getPoFileUrl($module_template, $type, $lang);
- Create a ticketCreate a ticket
Method update
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function update($module_template, $type, $lang) {
$strings = (array) json_decode($this->input->post('results'));
$translations = $this->makeCorrectPoPaths($module_template, $type, $lang, TRUE);
- Create a ticketCreate a ticket
Function renderModulePoFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function renderModulePoFile($module_template, $type, $lang) {
$this->session->unset_userdata('translation');
$url = $this->poFileManager->getPoFileUrl($module_template, $type, $lang);
- 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 updateOne
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function updateOne() {
$name = $this->input->post('name');
$type = $this->input->post('type');
$locale = $this->input->post('locale');
- 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 renderModulesNames
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function renderModulesNames($lang) {
$langs = $this->session->userdata('langs_modules');
$langs = $langs[$lang];
$langs = sort_names($langs);
- 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 savePoArray
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function savePoArray($module_template, $type, $lang) {
$po_array = (array) json_decode($this->input->post('po_array'));
$showMessage = (bool) $this->input->post('showMessage');
- 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"