YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function process has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): void
    {
        if ($this->checkExceptions('CreatedHelpDesk')) {
            return;
        }
Severity: Minor
Found in app/Mail/ScannerAction/CreatedHelpDesk.php - About 1 hr 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 process has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(\App\Request $request)
    {
        if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
            header("location: https://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}", true, 301);
        }
Severity: Minor
Found in app/Main/File.php - About 1 hr 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 getRecordVariable has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRecordVariable($fieldType = false)
    {
        $cacheKey = "{$this->moduleName}|$fieldType";
        if (isset(static::$recordVariable[$cacheKey])) {
            return static::$recordVariable[$cacheKey];
Severity: Minor
Found in app/TextParser.php - About 1 hr 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 checkPermission has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkPermission(\App\Request $request)
    {
        if ($request->has('record')) {
            if (!\App\Security\AdminAccess::isPermitted('MailRbl')) {
                throw new \App\Exceptions\NoPermittedForAdmin('LBL_PERMISSION_DENIED');
Severity: Minor
Found in app/Controller/Components/View/MailMessageAnalysisModal.php - About 1 hr 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 getToInstall has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getToInstall(): array
    {
        $data = self::get();
        if (\Config\Developer::$updaterDevMode) {
            $where = ['like', 'from_version',  self::$version . '.%', false];
Severity: Minor
Found in app/YetiForce/Updater.php - About 1 hr 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 process has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): string
    {
        $html = '';
        $moduleName = 'Calendar';
        if (!empty($textParserParams = $this->textParser->getParam('textParserParams')) && isset($textParserParams['userId'])) {
Severity: Minor
Found in app/TextParser/UserCalendar.php - About 1 hr 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 updateLabel has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function updateLabel(string $moduleName, int $id): void
    {
        $dbCommand = \App\Db::getInstance()->createCommand();
        $labelTableName = \App\RecordSearch::LABEL_TABLE_NAME;
        $searchTableName = \App\RecordSearch::SEARCH_TABLE_NAME;
Severity: Minor
Found in app/Record.php - About 1 hr 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 verifyDmarcSpf has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function verifyDmarcSpf(string $fromDomain, string $aspf): array
    {
        $mailFrom = '';
        if ($returnPath = $this->getHeaderEmail('Return-Path')) {
            $mailFrom = explode('@', $returnPath)[1];
Severity: Minor
Found in app/Mail/Rbl.php - About 1 hr 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 getLabel has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getLabel($mixedId, bool $raw = false)
    {
        $multiMode = \is_array($mixedId);
        $ids = array_filter($multiMode ? array_unique($mixedId) : [$mixedId]);
        $result = $missing = [];
Severity: Minor
Found in app/Record.php - About 1 hr 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 process has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $moduleName = 'Calendar';
        $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        $currentUserModel = \App\User::getCurrentUserModel();
Severity: Minor
Found in app/TextParser/OverdueDeadlines.php - About 1 hr 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 decodeRow has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private static function decodeRow(string $baseText, string $type, int $id, string $label, string $format = self::FORMAT_HTML): string
    {
        $html = '';
        if (self::RECORD_SEPARATOR === $type) {
            switch ($format) {
Severity: Minor
Found in app/Utils/Completions.php - About 1 hr 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 ram has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private static function ram(): array
    {
        $mathCountGroup = 1000;
        $writeTime = $readTime = $readOperations = $writeOperations = 0;
        for ($i = 0; $i < 5; ++$i) {
Severity: Minor
Found in app/Utils/Benchmarks.php - About 1 hr 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 __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct()
    {
        $this->exec = \function_exists('exec');
        $this->climate = new \League\CLImate\CLImate();
        if (!$this->exec) {
Severity: Minor
Found in app/Cli.php - About 1 hr 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 validateInjection has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function validateInjection($data): bool
    {
        $return = true;
        if (\is_array($data)) {
            foreach ($data as $value) {
Severity: Minor
Found in app/Fields/File.php - About 1 hr 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 validateCodeInjectionInMetadata has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private function validateCodeInjectionInMetadata()
    {
        if (\extension_loaded('imagick')) {
            try {
                $img = new \imagick($this->path);
Severity: Minor
Found in app/Fields/File.php - About 1 hr 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 displayElapseTime has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function displayElapseTime($interval, string $formatIn = 'i', string $formatOut = 'ahi', bool $short = true): string
    {
        $dateFormat = [];
        $multiplier = 1;
        switch ($formatIn) {
Severity: Minor
Found in app/Fields/RangeTime.php - About 1 hr 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 getGroups has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function getGroups($addBlank = true, $private = '')
    {
        \App\Log::trace("Entering getGroups($addBlank,$private) method ...");
        $moduleName = '';
        if ('Settings' !== \App\Request::_get('parent') && $this->moduleName) {
Severity: Minor
Found in app/Fields/Owner.php - About 1 hr 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 getQueriesForRelatedRecords has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getQueriesForRelatedRecords(int $record, string $moduleName, array $hierarchy, Db\Query $subQuery = null): array
    {
        $modules = static::getChildModules($moduleName, $hierarchy);
        $queries = [];
        if ($modules) {
Severity: Minor
Found in app/ModuleHierarchy.php - About 1 hr 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 formatToRangeText has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function formatToRangeText($value, $mode = 'short', $showEmptyValue = true, $unit = 'h')
    {
        $full = $short = [];
        $hours = (int) $value;
        if ('y' === $unit) {
Severity: Minor
Found in app/Fields/RangeTime.php - About 1 hr 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 recordData has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public static function recordData(\Vtiger_Record_Model $recordModel, array $migrate)
    {
        foreach ($migrate as $recordId => $fields) {
            if (!Record::isExists($recordId) || (($sourceRecord = \Vtiger_Record_Model::getInstanceById($recordId)) && (!$sourceRecord->isViewable()))) {
                throw new Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
Severity: Minor
Found in app/RecordTransfer.php - About 1 hr 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