Showing 4,652 of 306,333 total issues
Method setDataFromRequest
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setDataFromRequest(App\Request $request)
{
foreach (array_keys($this->getEditFields()) as $field) {
if ($request->has($field)) {
switch ($field) {
Method getFieldInstanceByName
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFieldInstanceByName($name)
{
$moduleName = $this->getModule()->getName(true);
$params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
switch ($name) {
Method process
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$qualifiedModuleName = $request->getModule(false);
$recordId = $request->isEmpty('record', true) ? 0 : $request->getInteger('record');
$moduleModelList = Settings_PickListDependency_Module_Model::getPicklistSupportedModules();
Method process
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$qualifiedModuleName = $request->getModule(false);
$supportedModules = Settings_RecordNumbering_Module_Model::getSupportedModules();
$sourceModule = $request->getByType('sourceModule', 2);
Method getRenewalValue
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getRenewalValue()
{
if ($this->isEmpty('product') || !\App\Record::isExists($this->get('product'), 'Products')) {
return 'PLL_NOT_APPLICABLE_VERIFICATION';
}
Method getRecordsByStatus
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getRecordsByStatus(array $params, Vtiger_Paging_Model $pagingModel, $user): array
{
if (!$user) {
$user = \App\User::getCurrentUserId();
}
Method process
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$widget = Vtiger_Widget_Model::getInstance($request->getInteger('linkid'), \App\User::getCurrentUserId());
Method downloadFiles
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function downloadFiles($recordsIds)
{
$zip = new ZipArchive();
$postfix = time() . '_' . random_int(0, 1000);
$zipPath = ROOT_DIRECTORY . '/cache/';
Method validate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validate($value, $isUserFormat = false)
{
$hashValue = \is_array($value) ? md5(print_r($value, true)) : $value;
if (isset($this->validate[$hashValue]) || empty($value)) {
return;
Method getCustomViewList
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getCustomViewList(): array
{
if (isset($this->customViewList)) {
return $this->customViewList;
}
Method reloadCache
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function reloadCache()
{
$members = $users = [];
$dataReader = (new App\Db\Query())->from('u_#__watchdog_module')->createCommand()->query();
while ($row = $dataReader->read()) {
Method checkUserPermissions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkUserPermissions()
{
$permissions = $this->get('template_members');
if (empty($permissions)) {
return true;
Method showTaxes
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showTaxes(App\Request $request)
{
$moduleName = $request->getModule();
$record = $request->getInteger('record');
$recordModule = $request->getByType('recordModule', 'Alnum');
Method getFieldInstanceByName
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getFieldInstanceByName($name)
{
if (!isset($this->customFields[$name])) {
return parent::getFieldInstanceByName($name);
}
Method process
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(App\Request $request)
{
$viewer = $this->getViewer($request);
$data = $request->getAll();
$moduleName = $request->getModule();
Method handleError
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handleError(): void
{
if (\App\Config::debug('apiLogException')) {
$request = Request::init();
$error = "code: {$this->getCode()} | message: {$this->getMessage()}\n";
Function loadFieldSpecificUi
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
loadFieldSpecificUi(fieldSelect) {
const selectedOption = fieldSelect.find('option:selected');
const row = fieldSelect.closest('div.js-conditions-row');
const fieldUiHolder = row.find('.fieldUiHolder');
const fieldInfo = selectedOption.data('fieldinfo');
- 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 saveFieldValues
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
saveFieldValues: function (fieldDetailList) {
var aDeferred = jQuery.Deferred();
var recordId = this.getRecordId();
var 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 getRecordsListParams
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getRecordsListParams: function (container) {
let formElement = container.closest('form');
let sourceModule = $('input[name="module"]', formElement).val();
let popupReferenceModule = $('input[name="popupReferenceModule"]', container).val();
let sourceFieldElement = $('input[class="sourceField"]', container);
- 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 registerKeyboardShortcutsEvent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
registerKeyboardShortcutsEvent: function () {
document.addEventListener('keydown', (event) => {
if (event.shiftKey && event.ctrlKey && event.code === 'KeyS') {
let form = event.target.closest('form');
if (form) {
- 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"