Showing 4,652 of 306,333 total issues
Function addMiniListWidget
has 149 lines of code (exceeds 25 allowed). Consider refactoring. Open
addMiniListWidget: function (element, url) {
// 1. Show popup window for selection (module, filter, fields)
// 2. Compute the dynamic mini-list widget url
// 3. Add widget with URL to the page.
const thisInstance = this;
Function getDateRangeByType
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public static function getDateRangeByType($type, $dateObject = null)
{
$currentUser = \App\User::getCurrentUserModel();
$weekStartDay = $currentUser->getDetail('dayoftheweek');
- 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 getRelatedLevelVariable
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function getRelatedLevelVariable($fieldType = false)
{
$cacheKey = "{$this->moduleName}|$fieldType";
if (isset(static::$relatedVariableLevel[$cacheKey])) {
return static::$relatedVariableLevel[$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 getExpectedTimes
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
private static function getExpectedTimes(int $id, \Vtiger_Record_Model $recordModel, array $type): array
{
$return = [];
$date = new \DateTime();
if ($id && ($rules = self::getRulesForServiceContracts($id, $recordModel)) || ($rules = self::getSlaPolicyRulesForModule($recordModel))) {
- 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 doTask
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function doTask($recordModel)
{
if (!empty($this->template)) {
$mailerContent = [];
if (!empty($this->smtp)) {
- 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
File Module.php
has 410 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Settings OSSMailView index view class.
*
* @copyright YetiForce S.A.
`` has 43 functions (exceeds 20 allowed). Consider refactoring. Open
export default {
setDialog(state, idOpen) {
state.session.dialog = idOpen
},
miniMode(state, isMini) {
PrivilegeUtil
has 43 functions (exceeds 20 allowed). Consider refactoring. Open
class PrivilegeUtil
{
/** @var int Allowed group nests */
public const GROUP_LOOP_LIMIT = 5;
Method purifyByType
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function purifyByType($input, $type, $convert = false)
{
if (\is_array($input)) {
$value = [];
foreach ($input as $k => $v) {
Method process
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$moduleName = $request->getModule();
$relatedModuleName = $request->getByType('relatedModule', 2);
$parentId = $request->getInteger('record');
File ServiceContracts.php
has 408 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Service contracts utils file.
*
* @package App
File CardDAV.php
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Api CardDAV Model Class.
*
Method getFieldItemByName
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFieldItemByName($name)
{
if (isset($this->items[$name])) {
return $this->items[$name];
}
Method operationsAfterPicklistRename
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function operationsAfterPicklistRename($entityData)
{
$dbCommand = App\Db::getInstance()->createCommand();
$pickListFieldName = $entityData['fieldname'];
$oldValue = $entityData['oldvalue'];
Function recordSaveAttendee
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function recordSaveAttendee(\Vtiger_Record_Model $record)
{
if ('VEVENT' === (string) $this->vcomponent->name) {
$invities = $this->getInvitations($record->getId());
$time = VObject\DateTimeParser::parse($this->vcomponent->DTSTAMP);
- 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 saveLocks
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function saveLocks($data)
{
$oldValues = $this->getLocks();
$map = $toSave = [];
if (!empty($data)) {
- 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 getRates
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function getRates($otherCurrencyCode, $dateParam, $cron = false)
{
$moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance();
$selectedBank = $moduleModel->getActiveBankId();
$yesterday = date('Y-m-d', strtotime('-1 day'));
- 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 getNextTriggerTimeForWeekly
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function getNextTriggerTimeForWeekly($scheduledDaysOfWeek, $scheduledTime)
{
$weekDays = ['1' => 'Monday', '2' => 'Tuesday', '3' => 'Wednesday', '4' => 'Thursday', '5' => 'Friday', '6' => 'Saturday', '7' => 'Sunday'];
$currentTime = time();
$currentWeekDay = date('N', $currentTime);
- 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 getListViewHeaders
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
public function getListViewHeaders()
{
$headerFieldModels = [];
if ($this->isEmpty('viewId')) {
$queryGenerator = $this->getQueryGenerator();
- 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 ProgressIndicatorHelper
has 142 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ProgressIndicatorHelper = function () {
var thisInstance = this;
this.defaults = {
position: 'append',