Showing 4,652 of 306,333 total issues
Function getUsersByGroup
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public static function getUsersByGroup($groupId, $subGroups = false, $i = 0)
{
$cacheKey = $groupId . (false === $subGroups ? '' : '#');
if (Cache::has('getUsersByGroup', $cacheKey)) {
return Cache::get('getUsersByGroup', $cacheKey);
- 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 getMenu
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public static function getMenu(string $moduleName, string $view, string $mode = '', &$selected = null): array
{
$selectedFieldId = 0;
$selectedBlockId = 0;
$menu = [];
- 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 setFieldMapping
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function setFieldMapping($fieldValueMapping, $recordModel, $parentRecordModel)
{
$ownerFields = [];
$entityType = $this->entity_type;
foreach ($recordModel->getModule()->getFields() as $name => $fieldModel) {
- 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 loadFieldInfo
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function loadFieldInfo(): array
{
if (null !== $this->fieldInfo) {
return $this->fieldInfo;
}
- 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 getTicketsByStatus
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function getTicketsByStatus($owner)
{
$moduleName = 'HelpDesk';
$ticketStatus = Settings_SupportProcesses_Module_Model::getTicketStatusNotModify();
$query = new \App\Db\Query();
- 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 transformInventoryFieldFromMap
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function transformInventoryFieldFromMap($value, $mapData)
{
if (!empty($value)) {
if ($this->currentInventoryRawData['name']) {
[$entityName] = $this->transformInventoryReference($this->currentInventoryRawData['name'], true);
- 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 registerUnlock
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerUnlock: function (container) {
let form = container.find('.js-filter-form');
App.Fields.Date.registerRange(form);
let table = $('#js-unlock-table');
if (table.hasClass('dataTable')) {
Method exportFields
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function exportFields(ModuleBasic $moduleInstance, $blockid)
{
$dataReader = (new \App\Db\Query())->from('vtiger_field')->where(['tabid' => $moduleInstance->id, 'block' => $blockid])->createCommand()->query();
if (0 === $dataReader->count()) {
return;
Method addField
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function addField($fieldType, $blockId, $params)
{
$label = $params['fieldLabel'];
$name = strtolower($params['fieldName']);
$pickListValues = [];
File Widgets.js
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* {[The file is published on the basis of YetiForce Public License 6.5 that can be found in the following directory: licenses/LicenseEN.txt or yetiforce.com]} */
'use strict';
jQuery.Class(
'Settings_Widgets_Index_Js',
File Rule.php
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Settings SharingAccess rule model class.
*
* @copyright YetiForce S.A.
Calendar_Js
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
window.Calendar_Js = class {
static monthFormat = {
'yyyy-mm-dd': 'YYYY-MMMM',
'mm-dd-yyyy': 'MMMM-YYYY',
'dd-mm-yyyy': 'MMMM-YYYY',
CustomView
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class CustomView
{
const CV_STATUS_DEFAULT = 0;
const CV_STATUS_PRIVATE = 1;
const CV_STATUS_PENDING = 2;
Request
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Request
{
/**
* Raw request data.
*
Vtiger_Widget_Model
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Vtiger_Widget_Model extends \App\Base
{
/** @var array Default labels */
const DEFAULT_LABELS = [
'Activities' => 'LBL_ACTIVITIES',
Function loadFieldSpecificUi
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadFieldSpecificUi: function (fieldSelect) {
const selectedOption = fieldSelect.find('option:selected');
const row = fieldSelect.closest('div.js-conditions-row');
const fieldUiHolder = row.find('.fieldUiHolder');
const conditionSelectElement = row.find('select[name="comparator"]');
Method getTimeZones
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getTimeZones()
{
return [
'Pacific/Midway',
'Pacific/Samoa',
Method imapConnect
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function imapConnect($user, $password, $host = '', $folder = 'INBOX', $dieOnError = true, $config = [], array $account = [])
{
\App\Log::trace("Entering OSSMail_Record_Model::imapConnect($user , '****' , $folder) method ...");
if (!$config) {
$config = self::loadRoundcubeConfig();
Method process
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$userId = \App\User::getCurrentUserId();
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
Function copySelectedOptions
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
copySelectedOptions: function (source, destination) {
let srcObj = jQuery(source);
let destObj = jQuery(destination);
if (typeof srcObj === 'undefined' || typeof destObj === 'undefined') return;
- 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"