Showing 4,652 of 306,333 total issues
Method testGetProducts
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testGetProducts(): void
{
$recordModel = \Tests\Base\C_RecordActions::createProductRecord();
$dataBefore = $recordModel->getData();
$recordModel->set('share_externally', 1);
Method initInventoryValuesAuto
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function initInventoryValuesAuto()
{
$invData = [];
$counter = 1;
foreach ($this->cleanRecordModels as $groupBy => $newRecordModel) {
Method relatedRecordLevel
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function relatedRecordLevel($params)
{
[$fieldName, $relatedModule, $relatedRecord] = array_pad(explode('|', $params, 3), 3, '');
if (
!isset($this->recordModel)
Method purifyMultiDimensionArray
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function purifyMultiDimensionArray($values, $template)
{
if (\is_array($template)) {
foreach ($values as $firstKey => $value) {
if (\is_array($value)) {
Method showHelp
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function showHelp(): void
{
if ($this->climate->arguments->defined('module')) {
$module = $this->climate->arguments->get('module');
$className = "\\App\\Cli\\{$module}";
Method getWarnings
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getWarnings($folders, $active = true)
{
if (empty($folders)) {
return [];
}
Method import
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function import(): bool
{
$allChecked = false;
try {
if ($customers = $this->getCustomersFromApi()) {
Method syncAccount
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function syncAccount(array $data): int
{
$recordModel = \Vtiger_Record_Model::getCleanInstance('Accounts');
if ($id = $this->findAccount($data, $recordModel)) {
$recordModel = \Vtiger_Record_Model::getInstanceById($id, 'Accounts');
Method parsePhone
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function parsePhone(): void
{
$country = null;
if ($userId = $this->user ? $this->user->getId() : null) {
$country = \App\Fields\Country::getCountryCode(\App\User::getUserModel($userId)->getDetail('sync_carddav_default_country'));
Method getDataFromApi
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getDataFromApi(array $params): void
{
try {
$client = \App\RequestHttp::getClient(['headers' => ['Authorization' => 'Bearer ' . $this->bearerToken]]);
$response = $client->post($this->url . 'query', ['json' => $params]);
Method getInstance
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getInstance($value, $module = false, $type = '')
{
switch ($type) {
case 'SELF':
$fieldModel = parent::getInstance($value, $module);
Method __getParentEmployees
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __getParentEmployees($id, &$parentAccounts, &$encounteredAccounts)
{
$parentId = (new App\Db\Query())
->select(['parentid'])
->from('vtiger_ossemployees')
Method step
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function step($step, App\Request $request)
{
$viewer = $this->getViewer($request);
$moduleName = $request->getModule();
$qualifiedModuleName = $request->getModule(false);
Method update
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function update(App\Request $request): void
{
$db = \App\Db::getInstance('admin');
$requestMode = \in_array($request->getByType('type'), ['forVerification', 'toSend', 'request']);
$response = new Vtiger_Response();
Method insertIntoInviteTable
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function insertIntoInviteTable()
{
if (!\App\Request::_has('inviteesid')) {
\App\Log::info('No invitations in request, Exiting insertIntoInviteeTable method ...');
return;
Method getPrivileges
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getPrivileges($userId)
{
$recordId = false;
if (!empty($this->get('sourceRecord'))) {
$recordId = $this->get('sourceRecord');
Method findEmailAddress
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function findEmailAddress($field, $searchModule = false, $returnArray = true)
{
$return = [];
$emails = $this->get($field);
if (empty($emails)) {
Method recordSync
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function recordSync(): int
{
\App\Log::trace('Start', __METHOD__);
$query = (new \App\Db\Query())->select([
'dav_calendarobjects.*',
Method getRoomsMessages
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getRoomsMessages(App\Request $request)
{
$result = [];
$roomList = \App\Chat::getRoomsByUser();
$areNewEntries = false;
Method reviewChanges
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function reviewChanges()
{
$db = \App\Db::getInstance();
$recordsList = $this->getRecords();
if (!empty($recordsList)) {