Showing 4,652 of 306,333 total issues
Function validate
has a Cognitive Complexity of 52 (exceeds 5 allowed). Consider refactoring. Open
private static function validate(string $type)
{
$main = static::parse($type);
$cron = static::getCronVariables($type);
foreach (static::${$type} as $key => &$item) {
- 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 registerEvents
has 201 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerEvents: function () {
const thisIstance = this,
container = jQuery('.contentsDiv');
thisIstance.registerColorField($('#exceptions select'));
thisIstance.registerEditFolders(container);
File Header.js
has 501 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*+***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
File
has 56 functions (exceeds 20 allowed). Consider refactoring. Open
class File
{
/** @var string Temporary table name. */
public const TABLE_NAME_TEMP = 'u_#__file_upload_temp';
Function process
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
$html = '';
if (!$this->textParser->recordModel->getModule()->isInventory()) {
return $html;
- 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 51 (exceeds 5 allowed). Consider refactoring. Open
public function doTask($recordModel)
{
if (!\App\Module::isModuleActive('Calendar')) {
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"
Further reading
Function getStructure
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public function getStructure()
{
if (!empty($this->structuredValues)) {
return $this->structuredValues;
}
- 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 read
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public function read()
{
$this->createTable();
$fieldMapping = $this->request->get('field_mapping');
$inventoryFieldMapping = $this->request->get('inventory_field_mapping');
- 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 getConditions
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
public static function getConditions(\App\Db\Query $query, string $moduleName, $user = false, $relatedRecord = null)
{
if (!($user && $user instanceof \App\User)) {
$user = \App\User::getCurrentUserModel();
}
- 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 VTJsonCondition.php
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/* +**********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
Method getPluralized
has 196 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getPluralized($count)
{
//Extract language code from locale with special cases
if (0 === strcasecmp(static::getLanguage(), 'pt-BR')) {
$lang = 'pt-BR';
Users_Record_Model
has 55 functions (exceeds 20 allowed). Consider refactoring. Open
class Users_Record_Model extends Vtiger_Record_Model
{
/** {@inheritdoc} */
public function getModule(): Vtiger_Module_Model
{
File CustomView.php
has 492 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Custom view file.
*
* @package App
Function doTask
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
public function doTask($recordModel)
{
$fieldValueMapping = [];
if (!empty($this->field_value_mapping)) {
$fieldValueMapping = \App\Json::decode($this->field_value_mapping);
- 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
Method getDateRangeByType
has 193 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getDateRangeByType($type, $dateObject = null)
{
$currentUser = \App\User::getCurrentUserModel();
$weekStartDay = $currentUser->getDetail('dayoftheweek');
File AdvanceFilter.js
has 486 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*+***********************************************************************************
* The contents of this file are subject to the vtiger CRM Public License Version 1.0
* ("License"); You may not use this file except in compliance with the License
* The Original Code is: vtiger CRM Open Source
* The Initial Developer of the Original Code is vtiger.
Function relations
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public static function relations(int $sourceId, array $records)
{
$sourceRecord = \Vtiger_Record_Model::getInstanceById($sourceId);
foreach ($records as $recordId) {
$recordModel = \Vtiger_Record_Model::getInstanceById($recordId);
- 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 49 (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
File LangManagement.js
has 480 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';
var Settings_Index_Js = {
initEvants: function () {
TextParser
has 53 functions (exceeds 20 allowed). Consider refactoring. Open
class TextParser
{
/**
* Examples of supported variables.
*