YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function updateLabels has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function updateLabels(int $fromUserId = 0): void
    {
        $timeLimit = 180;
        $timeMax = $timeLimit + time();
        $query = (new \App\Db\Query())->select(['id'])->where(['>=', 'id', $fromUserId])->from('vtiger_users');
Severity: Minor
Found in app/User.php - About 25 mins to fix

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 loadWatermark has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadWatermark()
    {
        $this->watermark = '';
        if (self::WATERMARK_TYPE_IMAGE === $this->template->get('watermark_type') && '' !== trim($this->template->get('watermark_image'))) {
            if ($this->template->get('watermark_image')) {
Severity: Minor
Found in app/Pdf/Drivers/YetiForcePDF.php - About 25 mins to fix

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 getGlobalTax has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getGlobalTax(string $value, bool $addIfNotExist = false): string
    {
        $value = (float) $value;
        $taxes = '';
        foreach (\Vtiger_Inventory_Model::getGlobalTaxes() as $key => $tax) {
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer.php - About 25 mins to fix

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 reloadCache has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function reloadCache()
    {
        $db = Db::getInstance('admin');
        $query = (new Db\Query())->from('a_#__adv_permission')->where(['status' => 0])->orderBy(['priority' => SORT_DESC]);
        $dataReader = $query->createCommand($db)->query();
Severity: Minor
Found in app/PrivilegeAdvanced.php - About 25 mins to fix

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 getDataCrm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDataCrm(bool $onEdit = false): array
    {
        $parsedData = parent::getDataCrm($onEdit);
        if (!empty($shippingAddress = $this->getAddressDataCrm('shipping'))) {
            $parsedData = \array_replace_recursive($parsedData, $shippingAddress);
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Maps/Order.php - About 25 mins to fix

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 findByEmail has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function findByEmail(array $data, \Vtiger_Record_Model $recordModel): int
    {
        $email = $data['email'] ?? $data['email_a'];
        $cacheKey = 'MagentoFindByEmail' . $recordModel->getModuleName();
        if (\App\Cache::staticHas($cacheKey, $email)) {
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Record.php - About 25 mins to fix

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 setValuesForCreateRecord has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function setValuesForCreateRecord(\Vtiger_Record_Model $record): void
    {
        if ('Contacts' === $record->getModuleName() && isset($this->card->ORG)) {
            $lead = \Vtiger_Record_Model::getCleanInstance('Leads');
            $lead->set('assigned_user_id', $this->user->get('id'));
Severity: Minor
Found in app/Integrations/Dav/Card.php - About 25 mins to fix

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 createState has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function createState()
    {
        $state = $this->record->get('state');
        $values = [
            'PLL_OPAQUE' => 'OPAQUE',
Severity: Minor
Found in app/Integrations/Dav/Calendar.php - About 25 mins to fix

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 getCurrencyParam has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getCurrencyParam(int $currencyId): array
    {
        $baseCurrency = $this->getBaseCurrency();
        $defaultCurrencyId = $baseCurrency['default']['id'];
        if (!empty($this->row['DATA_KURS_WAL'])) {
Severity: Minor
Found in app/Integrations/Wapro/Synchronizer/Invoice.php - About 25 mins to fix

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 generate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function generate($type = 'all')
    {
        switch ($type) {
            case 'user':
            case 'group':
Severity: Minor
Found in app/Colors.php - About 25 mins to fix

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 getCustomAttributeValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCustomAttributeValue(string $name)
    {
        $value = '';
        $customAttributes = $this->data['custom_attributes'];
        if (!empty($customAttributes)) {
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Maps/Base.php - About 25 mins to fix

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 getDataCrm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDataCrm(bool $onEdit = false): array
    {
        $parsedData = parent::getDataCrm($onEdit);
        if (!empty($shippingAddress = $this->getAddressDataCrm('shipping'))) {
            $parsedData = \array_replace_recursive($parsedData, $shippingAddress);
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Maps/Invoice.php - About 25 mins to fix

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 parsePhone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function parsePhone(string $fieldName, array $parsedData): array
    {
        if (\App\Config::main('phoneFieldAdvancedVerification', false)) {
            $phoneUtil = \libphonenumber\PhoneNumberUtil::getInstance();
            try {
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Maps/Base.php - About 25 mins to fix

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 getTemplatesList has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getTemplatesList(): array
    {
        $listTemplates = [];
        $pathDirectory = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'app' . \DIRECTORY_SEPARATOR . 'RecordAddsTemplates';
        if (file_exists($pathDirectory)) {
Severity: Minor
Found in app/RecordAddsTemplates.php - About 25 mins to fix

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 saveToDb has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function saveToDb()
    {
        $entityInstance = $this->getModule()->getEntityInstance();
        $db = \App\Db::getInstance();
        $valuesForSave = $this->getValuesForSave();
Severity: Minor
Found in modules/Users/models/Record.php - About 25 mins to fix

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 doLogin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function doLogin($password)
    {
        $userName = $this->get('user_name');
        $row = (new App\Db\Query())->select(['id', 'deleted'])->from('vtiger_users')->where(['or', ['user_name' => $userName], ['user_name' => strtolower($userName)]])->limit(1)->one();
        if (!$row || 0 !== (int) $row['deleted']) {
Severity: Minor
Found in modules/Users/models/Record.php - About 25 mins to fix

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 __destruct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function __destruct()
    {
        if (!static::$keepLogFile) {
            if (!static::$logActive) {
                return;
Severity: Minor
Found in app/Cron.php - About 25 mins to fix

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 search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function search(): array
    {
        if (!$this->isActive()) {
            return [];
        }
Severity: Minor
Found in app/RecordCollectors/Vies.php - About 25 mins to fix

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 parseData has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private function parseData(): void
    {
        if (empty($this->data)) {
            return;
        }
Severity: Minor
Found in app/RecordCollectors/PlKrs.php - About 25 mins to fix

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 search has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function search(): array
    {
        if (!$this->isActive()) {
            return [];
        }
Severity: Minor
Found in app/RecordCollectors/PlCeidg.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language