Showing 4,652 of 306,333 total issues
Function getPicklistValues
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getPicklistValues(string $moduleName): array
{
$modules = $this->getParamsConfig();
if ($moduleName) {
foreach ($modules as $module => $field) {
- Read upRead up
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 getDefaultMandatoryFieldValues
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getDefaultMandatoryFieldValues()
{
$key = $this->module . '_' . $this->user->getId();
if (\App\Cache::staticHas('DefaultMandatoryFieldValues', $key)) {
return \App\Cache::staticGet('DefaultMandatoryFieldValues', $key);
- Read upRead up
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 validateFileUpload
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function validateFileUpload(App\Request $request)
{
$currentUser = \App\User::getCurrentUserModel();
$uploadMaxSize = \App\Config::getMaxUploadSize();
- Read upRead up
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 getImportStatusCount
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getImportStatusCount()
{
$statusCount = ['TOTAL' => 0, 'IMPORTED' => 0, 'FAILED' => 0, 'PENDING' => 0,
'CREATED' => 0, 'SKIPPED' => 0, 'UPDATED' => 0, 'MERGED' => 0, ];
$tableName = Import_Module_Model::getDbTableName($this->user);
- Read upRead up
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 checkPermission
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function checkPermission(): void
{
parent::checkPermission();
$moduleName = $this->controller->request->getModule();
if ('POST' === $this->controller->method) {
- Read upRead up
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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function get(): array
{
$privileges = [];
if (\App\User::isExists($this->getUserData('user_id'))) {
$moduleName = $this->controller->request->getModule('module');
- Read upRead up
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 getQuery
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getQuery()
{
$queryGenerator = new \App\QueryGenerator($this->controller->request->getModule());
$limit = 1000;
if ($requestLimit = $this->controller->request->getHeader('x-row-limit')) {
- Read upRead up
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 getParentRecordsIdsRecursive
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getParentRecordsIdsRecursive($parentId, $parents = [])
{
if (empty($parentId)) {
return $parents;
}
- Read upRead up
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 debugRequest
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function debugRequest(): void
{
if (\App\Config::debug('apiLogAllRequests')) {
$log = '============ Request ' . \App\RequestUtil::requestId() . ' (Controller) ====== ' . date('Y-m-d H:i:s') . " ======\n";
$log .= 'REQUEST_METHOD: ' . \App\Request::getRequestMethod() . PHP_EOL;
- Read upRead up
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 entityAfterSave
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function entityAfterSave(App\EventHandler $eventHandler)
{
$recordModel = $eventHandler->getRecordModel();
if (!$recordModel->isNew()) {
if (false !== ($value = $recordModel->getPreviousValue('parentid'))) {
- Read upRead up
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 handleError
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function handleError(): void
{
if (\App\Config::debug('apiLogException')) {
$request = Request::init();
$error = "code: {$this->getCode()} | message: {$this->getMessage()}\n";
- Read upRead up
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 saveCommentAjax
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
element,
commentMode,
commentContentValue,
editCommentReason,
commentId,
Method register
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function register($name, $handlerClass, $frequency, $module = 'Home', $status = 1, $sequence = 0, $description = '')
Method imapConnect
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
Method setChartDatasetsColorsSingle
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function setChartDatasetsColorsSingle(&$chartData, $datasetIndex, $dataset, $groupValue, $group, $dividingValue, $dividing)
Method setChartDatasetsColorsMulti
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function setChartDatasetsColorsMulti(&$chartData, $datasetIndex, $dataset, $groupValue, $group, $dividingValue, $dividing)
Function triggerChangeAccessKey
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
triggerChangeAccessKey: function (url) {
app.showConfirmModal({
title: app.vtranslate('JS_NEW_ACCESS_KEY_REQUESTED'),
text: app.vtranslate('JS_CHANGE_ACCESS_KEY_CONFIRMATION'),
confirmedCallback: () => {
- Read upRead up
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 createTree
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
createTree: function () {
const self = this;
if (!this.jstreeInstance) {
self.jstreeLastID = parseInt($('#treeLastID').val());
let treeValues = $('#treeValues').val(),
- Read upRead up
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 onBusinessHoursRowClick
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
onBusinessHoursRowClick(e) {
e.stopPropagation();
const target = $(e.target);
const isCheckbox = target.hasClass('js-business-hours-checkbox');
const row = target.closest('tr');
- Read upRead up
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 loadDefaultValueWidget
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
loadDefaultValueWidget: function (element) {
var thisInstance = this;
var id = element.val() + '_defaultvalue';
var affectedRow = jQuery('#defaultValuesElementsContainer').find('#' + id);
var dafeultTd = element.closest('td').next();
- Read upRead up
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"