Showing 4,652 of 306,333 total issues
Function getAllByType
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getAllByType($tabid, $type = [], $parameters = false)
{
$links = Vtiger_Cache::get('links-' . $tabid, $type);
if (!$links) {
$links = parent::getAllByType($tabid, $type, $parameters);
- 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 getHistory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getHistory($pagingModel, $type = false)
{
if (empty($type)) {
$type = 'all';
}
- 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 getLabelToDisplay
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getLabelToDisplay(array $row): string
{
$name = '';
$type = $row['type'];
if (\is_int($type)) {
- 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 getRecordModelFromRequest
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function getRecordModelFromRequest(App\Request $request)
{
if (empty($this->record)) {
$this->record = $request->isEmpty('record', true) ? Vtiger_Record_Model::getCleanInstance($request->getModule()) : Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $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 getRecordDetail
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getRecordDetail(int $recordId, ?int $currencyId, string $moduleName, string $fieldName): array
{
$recordModel = Vtiger_Record_Model::getInstanceById($recordId);
if (!$recordModel->isViewable()) {
throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
- 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 formatDateIntoStrings
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function formatDateIntoStrings($date, $time = false)
{
$currentUser = Users_Record_Model::getCurrentUserModel();
$dateTimeInUserFormat = App\Fields\DateTime::formatToDisplay($date . ' ' . $time);
- 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 getHistory
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function getHistory(App\Request $request, Vtiger_Paging_Model $pagingModel)
{
$recordId = $request->getInteger('record');
if ($request->isEmpty('type')) {
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 get
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function get(App\Request $request)
{
if ($request->isEmpty('key', 2)) {
throw new \App\Exceptions\NoPermitted('Not Acceptable', 406);
}
- 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 editViewPreSave
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function editViewPreSave(App\EventHandler $eventHandler)
{
$recordModel = $eventHandler->getRecordModel();
$response = ['result' => true];
$dataQty = $productsName = [];
- 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 editViewPreSave
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function editViewPreSave(App\EventHandler $eventHandler)
{
$recordModel = $eventHandler->getRecordModel();
$response = ['result' => true];
$values = [];
- 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 getInventoryData
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getInventoryData(XMLReader $xmlToImport, $keyType)
{
$recordInventoryData = [];
$labels = [];
$columnsName = [];
- 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 add
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function add(App\Request $request, App\User $user)
{
if ($request->get('is_scheduled')) {
$temp_status = self::$IMPORT_STATUS_SCHEDULED;
} else {
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$data = [];
$sourceModule = $request->getByType('srcModule');
$srcModuleModel = Vtiger_Module_Model::getInstance($sourceModule);
- 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 saveBlockDetails
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
saveBlockDetails: function (form) {
var aDeferred = $.Deferred();
var progressIndicatorElement = $.progressIndicator({
position: 'html',
blockInfo: {
Function callback
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var callback = function (data) {
var params = app.validationEngineOptions;
params.onValidationComplete = function (form, valid) {
if (valid) {
var progressInstance = jQuery.progressIndicator({
Function updateSelectedFields
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateSelectedFields: function (target) {
const thisInstance = this;
let params = {},
relatedModule = $(target).closest('.relatedModule'),
progressIndicatorElement = $.progressIndicator({
Function registerForm
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerForm: function () {
let form = this.getTabForm();
form.on('submit', (event) => {
event.preventDefault();
form.validationEngine(app.validationEngineOptions);
Function registerTimeStartChangeEvent
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerTimeStartChangeEvent(container) {
const thisInstance = this;
container.find('input[name="time_start"]').on('change', function (e) {
thisInstance.setDefaultEndTime(container);
});
Function registerCacheSettings
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
registerCacheSettings() {
const self = this;
$('.siteBarRight .filterField').each(function (index) {
let name = $(this).attr('id');
let value = app.moduleCacheGet(name);
Function registerCustomViewAdvCondEvents
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
static registerCustomViewAdvCondEvents(listViewContainer) {
listViewContainer.on('click', '.js-custom-view-adv-cond-modal', () => {
const customViewAdvCond = listViewContainer.find('.js-custom-view-adv-cond');
let advancedConditions = customViewAdvCond.val();
if (advancedConditions) {