YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function addLink has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addLink($tabid, $type, $label, $url, $iconpath = '', $sequence = 0, $handlerInfo = null, $linkParams = null)
    {
        $db = \App\Db::getInstance();
        if (0 != $tabid) {
            $exists = (new \App\Db\Query())->from('vtiger_links')
Severity: Minor
Found in vtlib/Vtiger/Link.php - About 35 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 setDefaultSharing has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function setDefaultSharing(ModuleBasic $moduleInstance, $permissionText = 'Public_ReadWriteDelete')
    {
        $permissionText = strtolower($permissionText);

        if ('public_readonly' === $permissionText) {
Severity: Minor
Found in vtlib/Vtiger/Access.php - About 35 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 parseBytes has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function parseBytes($str): float
    {
        if (is_numeric($str)) {
            return (float) $str;
        }
Severity: Minor
Found in vtlib/Vtiger/Functions.php - About 35 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 __create has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function __create($moduleInstance)
    {
        $this->module = $moduleInstance;
        $this->isdefault = (true === $this->isdefault || 'true' == $this->isdefault) ? 1 : 0;
        $this->inmetrics = (true === $this->inmetrics || 'true' == $this->inmetrics) ? 1 : 0;
Severity: Minor
Found in vtlib/Vtiger/Filter.php - About 35 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 addFieldsAndBlock has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addFieldsAndBlock(string $moduleName)
    {
        $moduleModel = \Settings_LayoutEditor_Module_Model::getInstance('Settings:LayoutEditor')->setSourceModule($moduleName);
        $blockId = (new \App\Db\Query())->select(['blockid'])->from('vtiger_blocks')->where(['blocklabel' => 'BL_RECORD_STATUS_TIMES', 'tabid' => $moduleModel->getId()])->scalar();
        if (!$blockId) {
Severity: Minor
Found in app/RecordStatus.php - About 35 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 testLeadingZeros has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function testLeadingZeros(): void
    {
        for ($leadingZeros = 0; $leadingZeros < 7; ++$leadingZeros) {
            $actualNumber = 1;
            $prefix = '{{YYYY}}-{{MM}}-{{DD}}/';
Severity: Minor
Found in tests/Base/Z_ResetingRecordNumber.php - About 35 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 getNextQuarterRange has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getNextQuarterRange($month = 0, $dateObject = null)
    {
        $quarter = [];
        if (!$month) {
            $month = date('n');
Severity: Minor
Found in include/fields/DateTimeRange.php - About 35 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 process has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(): void
    {
        $this->status = 1;
        $errorsSecurity = \App\Utils\ConfReport::getErrors('security', true);
        unset($errorsSecurity['HTTPS']);
Severity: Minor
Found in app/SystemWarnings/Security/SecurityConf.php - About 35 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 getPreviousQuarterRange has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getPreviousQuarterRange($month = 0, &$dateObject = null)
    {
        $quarter = [];
        if (!$month) {
            $month = date('n');
Severity: Minor
Found in include/fields/DateTimeRange.php - About 35 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 getKeyRoom has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static function getKeyRoom($userRooms, string $roomType, int $recordId)
    {
        if (isset($userRooms[$roomType]) && \is_array($userRooms[$roomType])) {
            foreach ($userRooms[$roomType] as $key => $val) {
                if ($val['recordid'] === $recordId) {
Severity: Minor
Found in tests/Base/Z_Chat.php - About 35 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 resetCurrentView has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function resetCurrentView($moduleName = false)
    {
        if (\App\Session::has('lvs')) {
            if ($moduleName) {
                $lvs = \App\Session::get('lvs');
Severity: Minor
Found in app/CustomView.php - About 35 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 update has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function update($record, $moduleName)
    {
        $searchUsers = $recordAccessUsers = '';
        $users = Fields\Owner::getUsersIds();
        $searchable = isset(\App\RecordSearch::getSearchableModules()[$moduleName]);
Severity: Minor
Found in app/PrivilegeUpdater.php - About 35 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 vtwsUpdateConvertLeadStatus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function vtwsUpdateConvertLeadStatus($entityIds, $leadId, Users_Record_Model $user)
    {
        $db = \App\Db::getInstance();
        if ('' != $entityIds['Accounts'] || '' != $entityIds['Contacts']) {
            \App\Cache::delete('Leads.converted', $leadId);
Severity: Minor
Found in include/Webservices/ConvertLead.php - About 35 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 getlastLogs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getlastLogs($types = false)
    {
        $content = '';
        $i = 0;
        foreach (\Yii::getLogger()->messages as $message) {
Severity: Minor
Found in app/Log.php - About 35 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 getHeaders has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHeaders(): array
    {
        if (!$this->headers) {
            if ($this->fullData) {
                $this->headers = $this->getAllModuleFieldsAsHeaders();
Severity: Minor
Found in app/Export/Records.php - About 35 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 formatMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function formatMessage($message)
    {
        [$text, $level, $category, $timestamp] = $message;
        $level = \yii\log\Logger::getLevelName($level);
        if (!\is_string($text)) {
Severity: Minor
Found in app/Log/FileTarget.php - About 35 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 getAll has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getAll(bool $active = true, bool $allData = false)
    {
        $cacheKey = $active ? 'Active' : 'All';
        if (Cache::has('getAllLanguages', $cacheKey)) {
            if (!$allData) {
Severity: Minor
Found in app/Language.php - About 35 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 checkFieldMergeExist has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkFieldMergeExist()
    {
        $this->isFieldMergeExists = false;
        if (isset($this->fieldMapping['field_merge'])) {
            $destinyReferenceFields = $this->destinyModuleModel->getFieldsByReference();
Severity: Minor
Found in app/RecordConverter.php - About 35 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 checkActive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function checkActive(string $className, ?string $eventName = null): bool
    {
        $rows = (new \App\Db\Query())->from(self::$baseTable)->where(['handler_class' => $className])->all();
        $status = false;
        foreach ($rows as $row) {
Severity: Minor
Found in app/EventHandler.php - About 35 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 initLocale has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function initLocale()
    {
        $original = explode(';', setlocale(LC_ALL, 0));
        $defaultCharset = strtolower(\App\Config::main('default_charset'));
        setlocale(
Severity: Minor
Found in app/Language.php - About 35 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