Showing 4,652 of 306,333 total issues
Method testAddRecord
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testAddRecord(): void
{
$recordModel = \Tests\Base\C_RecordActions::createAccountRecord();
$request = $this->httpClient->post('HelpDesk/Record/', \App\Utils::merge(['json' => [
'ticket_title' => 'Api HelpDesk',
Method delete
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function delete()
{
$moduleInstance = \Vtiger_Module_Model::getInstance($this->name);
$focus = \CRMEntity::getInstance($this->name);
if (isset($focus->table_name)) {
Method testRelatedRecordsList
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testRelatedRecordsList()
{
$text = '$(relatedRecordsList : Accounts|lead_no,lastname,phone,description|[[["company","a","Test"]]]|All|5)$';
$result = \App\TextParser::getInstanceByModel(self::$recordLeads)
->setContent($text)
Method testGeneral
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function testGeneral()
{
$this->assertSame('+ ' . (new \DateTimeField(null))->getDisplayDate() . ' +', self::$parserClean
->setContent('+ $(general : CurrentDate)$ +')
->parse()
Method getByModule
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getByModule(int $tabId, ?int $gui = null): array
{
if (Cache::has('FieldsDependency', $tabId)) {
$fields = Cache::get('FieldsDependency', $tabId);
} else {
Method getOrignOrDefaultImgPath
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getOrignOrDefaultImgPath($imageFileName, $defaultFileName)
{
$basePath = '';
if (!IS_PUBLIC_DIR) {
$basePath = 'public_html/';
Method confReportAll
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function confReportAll(): void
{
\App\Process::$requestMode = 'Cron';
\App\Utils\ConfReport::$sapi = 'cron';
$all = \App\Utils\ConfReport::getAll();
Method getReceived
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getReceived(): array
{
$rows = [];
foreach ($this->mailMimeParser->getAllHeadersByName('Received') as $key => $received) {
$row = ['key' => $key, 'fromIP' => $received->getFromAddress() ?? ''];
Method verifySender
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function verifySender(): array
{
$from = $this->getHeaderEmail('from');
if (!$from) {
return ['status' => true, 'info' => ''];
Method validateSpace
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private static function validateSpace(string $name, array $row, string $sapi)
{
$dir = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR;
switch ($name) {
case 'spaceStorage':
Method getRoomsGlobal
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getRoomsGlobal(?int $userId = null): array
{
if (empty($userId)) {
$userId = User::getCurrentUserId();
}
Method getRoomsPrivate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getRoomsPrivate(?int $userId = null): array
{
if (empty($userId)) {
$userId = User::getCurrentUserId();
}
Method calculate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function calculate()
{
if (!\App\RequestUtil::isNetConnection()) {
throw new \App\Exceptions\AppException('ERR_NO_INTERNET_CONNECTION');
}
Method getPicklistValueImage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getPicklistValueImage($templateId, $moduleName, $treeId)
{
$value = ['name' => ''];
$rows = self::getValuesById((int) $templateId);
if (empty($rows[$treeId])) {
Method verifyDatabaseAccess
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function verifyDatabaseAccess(string $server, string $database, string $user, string $password, int $port): array
{
try {
$db = self::connectToDatabase($server, $database, $user, $password, $port);
if (0 === \count($db->getSchema()->getSchemaNames())) {
Method getDataFromApi
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getDataFromApi(array $query): void
{
$query['limit'] = self::LIMIT;
try {
$response = \App\RequestHttp::getClient()->request('GET', $this->url . '?' . http_build_query($query), [
Method getQueryToUsersByMembers
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function getQueryToUsersByMembers(array $members): Db\Query
{
$queryGenerator = (new \App\QueryGenerator('Users'))->setFields(['id']);
$columName = $queryGenerator->getColumnName('id');
$conditions = ['or'];
Method massReset
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function massReset(App\Request $request): void
{
$moduleName = $request->getModule();
$recordsList = Vtiger_Mass_Action::getRecordsListFromRequest($request);
foreach ($recordsList as $userId) {
Method step1
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function step1(App\Request $request)
{
$qualifiedModuleName = $request->getModule(false);
$params = $request->getByType('param', 'Text');
Method getPicklistValuesForRole
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getPicklistValuesForRole($roleIdList, $groupMode = 'INTERSECTION')
{
if (!$this->isRoleBased()) {
$fieldModel = new Vtiger_Field_Model();
return $fieldModel->getPicklistValues();