Showing 4,652 of 306,333 total issues
Settings_Groups_Record_Model
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Settings_Groups_Record_Model extends Settings_Vtiger_Record_Model
{
/** @var array Record changes */
protected $changes = [];
File Module.php
has 326 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Module Class for MappedFields Settings.
*
Function autoLink
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
autoLink() {
let fillChar = '\u200B';
let sel = window.getSelection(),
range = sel.getRangeAt(0).cloneRange(),
offset,
Method getHtmlConfig
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getHtmlConfig(array $options = [])
{
$config = \HTMLPurifier_Config::createDefault();
$config->set('Core.Encoding', static::$defaultCharset);
$config->set('Cache.SerializerPermissions', 0775);
Method getWidgetTimeControl
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getWidgetTimeControl($user, $time)
{
if (!$time) {
return ['show_chart' => false];
}
Method loadFieldInfo
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function loadFieldInfo(): array
{
if (null !== $this->fieldInfo) {
return $this->fieldInfo;
}
Method getValuesFromSource
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getValuesFromSource(App\Request $request, $moduleName = false)
{
$sourceModule = $request->getByType('sourceModule', 2);
if (
empty($sourceModule)
File Record.php
has 324 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
Function getPopUp
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
getPopUp: function (container) {
const thisInstance = this;
if (typeof container === 'undefined') {
container = thisInstance.getFilterContainer();
}
Function addTimeControl
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
addTimeControl(params, callback = () => {}) {
let aDeferred = jQuery.Deferred();
let referenceModuleName = 'OSSTimeControl';
let parentId = params.recordId;
let parentModule = 'HelpDesk';
- 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 throwNewException
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public static function throwNewException($e, $die = true, $messageHeader = 'LBL_ERROR')
{
if (!headers_sent() && \App\Config::security('cspHeaderActive')) {
header("content-security-policy: default-src 'self' 'nonce-" . \App\Session::get('CSP_TOKEN') . "'; object-src 'none';base-uri 'self'; frame-ancestors 'self';");
}
- 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 readCatalog
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public static function readCatalog(string $catalogToRead)
{
$catalogPath = static::getBackupCatalogPath();
$catalogToReadArray = $returnStructure = [];
if (empty($catalogPath)) {
- 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 import
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function import(): bool
{
$allChecked = false;
try {
if ($invoices = $this->getInvoicesFromApi()) {
- 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 getModulePermissions
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function getModulePermissions()
{
if (!isset($this->module_permissions)) {
$allModules = Vtiger_Module_Model::getAll([0], Settings_Profiles_Module_Model::getNonVisibleModulesList());
$profileTabPermissions = $this->getProfileTabPermissions();
- 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 26 (exceeds 5 allowed). Consider refactoring. Open
public function entityAfterSave(App\EventHandler $eventHandler)
{
$moduleName = $eventHandler->getModuleName();
// Update Used Units for the Service Contract, everytime the status of a ticket related to the Service Contract changes
if ('HelpDesk' === $moduleName && 'ServiceContracts' !== \App\Request::_get('return_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 getHierarchyData
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function getHierarchyData($id, $accountInfoBase, $accountId, &$listViewEntries)
{
\App\Log::trace('Entering getHierarchyData(' . $id . ',' . $accountId . ') method ...');
$hasRecordViewAccess = \App\Privilege::isPermitted('Accounts', 'DetailView', $accountId);
foreach ($this->hierarchyFields as &$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 process
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$this->preProcess($request);
$viewer = $this->getViewer($request);
$pdfModuleName = $moduleName = $request->getModule();
- 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 process
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function process()
{
foreach (App\Integrations\Magento\Config::getAllServers() as $serverId => $config) {
if (0 === (int) $config['status']) {
continue;
- 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 getWidget
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function getWidget()
{
$widget = [];
$model = Vtiger_Module_Model::getInstance($this->Data['relatedmodule']);
if ($model && $model->isPermitted('DetailView')) {
- 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 updateRelation
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function updateRelation(App\Request $request)
{
$sourceModule = $request->getModule();
$sourceRecordId = $request->getInteger('src_record');
$relatedModule = $request->getByType('related_module', 2);
- 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"