Showing 4,652 of 306,333 total issues
Function post
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function post(): array
{
if ($result = $this->checkBeforeSave()) {
return $result;
}
- 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 26 (exceeds 5 allowed). Consider refactoring. Open
public function get(): array
{
$displayData = $fieldsLabel = [];
$moduleName = $this->controller->request->get('module');
$setRawData = 1 === (int) ($this->controller->headers['x-raw-data'] ?? 0);
- 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 record
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function record($params, $isPermitted = true)
{
if (!isset($this->recordModel) || ($isPermitted && !Privilege::isPermitted($this->moduleName, 'DetailView', $this->record))) {
return '';
}
Function registerEditFieldDetailsClick
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerEditFieldDetailsClick: function (contents) {
var thisInstance = this;
if (typeof contents === 'undefined') {
contents = this.container.find('.contents');
}
Function getValues
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
getValues: function () {
const thisInstance = this,
filterContainer = this.getFilterContainer();
let fieldList = ['columnname', 'comparator', 'value', 'valuetype', 'column_condition'],
File Watchdog.php
has 320 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* YetiForce watchdog class.
* Modifying this file or functions that affect the footer appearance will violate the license terms!!!
*
Method save
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save(App\Request $request): void
{
$fieldId = $request->getInteger('fieldid');
if (empty($fieldId)) {
throw new \App\Exceptions\AppException('Empty field ID: ' . $fieldId);
Method save
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save()
{
$db = App\Db::getInstance();
$roleId = $this->getId();
$mode = 'edit';
Method process
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$this->preProcess($request);
$viewer = $this->getViewer($request);
$pdfModuleName = $moduleName = $request->getModule();
Settings_Workflows_Record_Model
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class Settings_Workflows_Record_Model extends Settings_Vtiger_Record_Model
{
/**
* Get record id.
*
Function getValues
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
getValues: function () {
const thisInstance = this;
let fieldList = new Array('columnname', 'comparator', 'value', 'valuetype', 'column_condition'),
values = {},
columnIndex = 0,
Method getRates
has 91 lines of code (exceeds 25 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'));
Method entityAfterSave
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function entityAfterSave(App\EventHandler $eventHandler)
{
if (!ModTracker::isTrackingEnabledForModule($eventHandler->getModuleName())) {
return false;
}
Method process
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$recordId = $request->getInteger('record');
File ModuleHierarchy.php
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App;
/**
File WebserviceStandard.php
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* WebserviceStandard Record Model file.
*
Function registerSearchAddress
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerSearchAddress: function () {
const searchValue = this.container.find('.js-search-address'),
searchBtn = this.container.find('.js-search-btn'),
operator = this.container.find('.js-select-operator');
if (operator.length && operator.val()) {
Method getRates
has 90 lines of code (exceeds 25 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'));
Function initEditView
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
initEditView: function () {
function toggleEditViewTableRow(e) {
var target = jQuery(e.currentTarget);
var container = jQuery('[data-togglecontent="' + target.data('togglehandler') + '"]');
var closestTrElement = container.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 loadConditions
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
loadConditions: function (fieldSelect) {
let row = fieldSelect.closest('div.js-conditions-row');
let conditionSelectElement = row.find('select[name="comparator"]');
let conditionSelected = conditionSelectElement.val();
let fieldSelected = fieldSelect.find('option:selected');
- 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"