YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function vtwsValidateConvertLeadEntityMandatoryValues has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function vtwsValidateConvertLeadEntityMandatoryValues($entity, Vtiger_Module_Model $targetModuleModel)
    {
        $mandatoryFields = $targetModuleModel->getMandatoryFieldModels();
        foreach ($mandatoryFields as $field => $fieldModel) {
            if (empty($entity[$field])) {
Severity: Minor
Found in include/Webservices/ConvertLead.php - About 55 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 check has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function check(int $record, string $moduleName): int
    {
        if (empty(\Config\Components\InterestsConflict::$isActive) || empty(\Config\Components\InterestsConflict::$modules[$moduleName])) {
            return self::CHECK_STATUS_INACTIVE;
        }
Severity: Minor
Found in app/Components/InterestsConflict.php - About 55 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 passwordAuth has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function passwordAuth(): void
    {
        $this->climate->arguments->add([
            'login' => [
                'prefix' => 'l',
Severity: Minor
Found in app/Cli/Users.php - About 55 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 parseSearchParams has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseSearchParams(array $searchParams): array
    {
        $glueOrder = ['AND', 'OR'];
        $searchParamsConditions = [];
        foreach ($searchParams as $key => $conditions) {
Severity: Minor
Found in app/QueryGenerator.php - About 55 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 delete has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete($key)
    {
        if (isset($this->purifiedValuesByGet[$key])) {
            unset($this->purifiedValuesByGet[$key]);
        }
Severity: Minor
Found in app/Request.php - About 55 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 getRecordNumberFromString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRecordNumberFromString(string $value, string $moduleName, bool $multi = false)
    {
        $moduleData = \App\Fields\RecordNumber::getInstance($moduleName);
        $prefix = str_replace(['\{\{YYYY\}\}', '\{\{YY\}\}', '\{\{MM\}\}', '\{\{DD\}\}', '\{\{M\}\}', '\{\{D\}\}'], ['\d{4}', '\d{2}', '\d{2}', '\d{2}', '\d{1,2}', '\d{1,2}'], preg_quote($moduleData->get('prefix'), '/'));
        $postfix = str_replace(['\{\{YYYY\}\}', '\{\{YY\}\}', '\{\{MM\}\}', '\{\{DD\}\}', '\{\{M\}\}', '\{\{D\}\}'], ['\d{4}', '\d{2}', '\d{2}', '\d{2}', '\d{1,2}', '\d{1,2}'], preg_quote($moduleData->get('postfix'), '/'));
Severity: Minor
Found in app/Mail/RecordFinder.php - About 55 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 validateReadAccess has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function validateReadAccess()
    {
        // Referer check if present - to over come && Check for user post authentication.
        if (\Config\Security::$verifyRefererHeader && isset($_SERVER['HTTP_REFERER']) && \App\User::getCurrentUserId() && 'Install' !== $this->get('module')) {
            $allowed = array_merge(\Config\Security::$allowedFrameDomains, \Config\Security::$allowedFormDomains);
Severity: Minor
Found in app/Request.php - About 55 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 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function findByEmail($emails, array $modulesFields): array
    {
        if (empty($emails)) {
            return [];
        }
Severity: Minor
Found in app/Mail/RecordFinder.php - About 55 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 operatorOgu has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function operatorOgu(): bool
    {
        $result = false;
        $groups = \App\User::getCurrentUserModel()->getGroups();
        if ($groups) {
Severity: Minor
Found in app/Conditions/RecordFields/SharedOwnerField.php - About 55 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 validateFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function validateFile(string $path)
    {
        if (!Validator::path($path)) {
            return true;
        }
Severity: Minor
Found in app/Zip.php - About 55 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 get has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function get($key, $value = '')
    {
        if (isset($this->purifiedValuesByGet[$key])) {
            return $this->purifiedValuesByGet[$key];
        }
Severity: Minor
Found in app/Request.php - About 55 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 custom has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function custom($params)
    {
        $instance = null;
        if (false !== strpos($params, '||')) {
            $params = explode('||', $params);
Severity: Minor
Found in app/TextParser.php - About 55 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 getDisplayValueByField has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getDisplayValueByField(\Vtiger_Field_Model $fieldModel, $value = false, $params = null)
    {
        $model = $this->recordModel;
        if (false === $value) {
            $value = \App\Utils\Completions::decode($this->recordModel->get($fieldModel->getName()), \App\Utils\Completions::FORMAT_TEXT);
Severity: Minor
Found in app/TextParser.php - About 55 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 getFolders has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getFolders()
    {
        $folders = [];
        $i = 0;
        foreach ($iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator(self::FOLDERS, \RecursiveDirectoryIterator::SKIP_DOTS), \RecursiveIteratorIterator::SELF_FIRST) as $item) {
Severity: Minor
Found in app/SystemWarnings.php - About 55 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 getQueryMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function getQueryMessage(?int $messageId, string $condition = '>', ?string $searchVal = null, bool $isLimit = true): Db\Query
    {
        $query = null;
        switch ($this->roomType) {
            case 'crm':
Severity: Minor
Found in app/Chat.php - About 55 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 find has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function find($value)
    {
        if (empty($value) || !\App\RequestUtil::isNetConnection()) {
            return [];
        }
Severity: Minor
Found in app/Map/Address/GoogleGeocode.php - About 55 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 calculate has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function calculate()
    {
        if (!\App\RequestUtil::isNetConnection()) {
            throw new \App\Exceptions\AppException('ERR_NO_INTERNET_CONNECTION');
        }
Severity: Minor
Found in app/Map/Routing/GraphHopper.php - About 55 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 import has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function import(): bool
    {
        $allChecked = false;
        try {
            if ($products = $this->getProductsFromApi()) {
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Product.php - About 55 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 getTmpPath has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getTmpPath()
    {
        if (isset(self::$tmpPath)) {
            return self::$tmpPath;
        }
Severity: Minor
Found in app/Fields/File.php - About 55 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 getErrorMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getErrorMessage(int $code): string
    {
        switch ($code) {
            case UPLOAD_ERR_INI_SIZE:
                $message = 'The uploaded file exceeds the upload_max_filesize directive in php.ini';
Severity: Minor
Found in app/Fields/File.php - About 55 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