YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

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

    public function getFieldFilterValueType($fieldname)
    {
        $conditions = $this->get('conditions');
        if (!empty($conditions) && \is_array($conditions)) {
            foreach ($conditions as $filter) {
Severity: Minor
Found in modules/Settings/Workflows/models/Record.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 getDisplayValueForEmail has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValueForEmail($emails)
    {
        $value = '';
        if ($emails) {
            foreach (\App\Json::decode($emails) as $email => $name) {
Severity: Minor
Found in modules/Settings/Mail/models/Record.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 row has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function row(App\Request $request): void
    {
        $sourceModuleName = $request->getByType('sourceModuleName', \App\Purifier::ALNUM);
        $sourceField = $request->getByType('sourceField', \App\Purifier::ALNUM);
        $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModuleName);
Severity: Minor
Found in modules/Settings/PickListDependency/views/ConditionBuilder.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 getFieldDataType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldDataType()
    {
        $fieldDataType = '';
        $uitype = $this->get('uitype');
        if ('9' == $uitype) {
Severity: Minor
Found in modules/Settings/Leads/models/Field.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 addDetail has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addDetail($prev, $post)
    {
        if (self::$lockTrack) {
            return true;
        }
Severity: Minor
Found in modules/Settings/Vtiger/models/Tracker.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 setDataFromRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function setDataFromRequest(App\Request $request)
    {
        foreach ($this->getModule()->getEditableFields() as $fieldName) {
            if ($request->has($fieldName)) {
                switch ($fieldName) {
Severity: Minor
Found in modules/Settings/AutomaticAssignment/models/Record.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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected function add()
    {
        $returnIds = [];
        $crmId = false;
        if (\App\Cache::has('getRecordByPrefix', $this->prefix)) {
Severity: Minor
Found in modules/OSSMailScanner/models/PrefixScannerAction.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 getActionsList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getActionsList()
    {
        $accountsPriority = ['CreatedEmail', 'CreatedHelpDesk', 'BindAccounts', 'BindContacts', 'BindLeads', 'BindHelpDesk', 'BindSSalesProcesses'];
        $moduleModel = Vtiger_Module_Model::getInstance('OSSMailScanner');
        $iterator = new DirectoryIterator($moduleModel->actionsDir);
Severity: Minor
Found in modules/OSSMailScanner/models/Record.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 activate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function activate(App\Request $request)
    {
        if ('outlook' === $request->getByType('source')) {
            $security = new \App\ConfigFile('security');
            $security->set('allowedScriptDomains', array_values(array_unique(array_merge((\Config\Security::$allowedScriptDomains), [
Severity: Minor
Found in modules/Settings/MailIntegration/actions/Activate.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 moduleHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => 'Partners'])->execute();

Severity: Minor
Found in modules/Partners/Partners.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 getInstanceById has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getInstanceById(int $id)
    {
        $db = App\Db::getInstance('admin');
        $instance = self::getCleanInstance();
        $baseTable = $instance->getTable();
Severity: Minor
Found in modules/Settings/AutomaticAssignment/models/Record.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 moduleHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();
            $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
Severity: Minor
Found in modules/SQuoteEnquiries/SQuoteEnquiries.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(OSSMail_Mail_Model $mail)
    {
        $this->mail = $mail;
        $campaignIds = $this->findAndBind();
        if (0 == $mail->get('type') && false !== $campaignIds && 0 != $campaignIds) {
Severity: Minor
Found in modules/OSSMailScanner/scanneractions/BindCampaigns.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(OSSMail_Mail_Model $mail, $moduleName)
    {
        $mailId = $mail->getMailCrmId();
        if (!$mailId) {
            return 0;
Severity: Minor
Found in modules/OSSMailScanner/models/EmailScannerAction.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 getEmailActionsListName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getEmailActionsListName($data)
    {
        $return = [];
        foreach ($data as $row) {
            if ('files' == $row[0]) {
Severity: Minor
Found in modules/OSSMailScanner/models/Record.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(App\Request $request)
    {
        if ($request->isJSON()) {
            $response = new Vtiger_Response();
            $listViewModel = Settings_Vtiger_ListView_Model::getInstance($request->getModule(false));
Severity: Minor
Found in modules/Settings/BusinessHours/views/List.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 getDisplayValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDisplayValue($value, $record = false, $recordModel = false, $rawText = false, $length = false)
    {
        if (empty($value)) {
            return '';
        }
Severity: Minor
Found in modules/Settings/Groups/uitypes/Multipicklist.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 validation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function validation(string $type, string $vale): bool
    {
        $returnVal = false;
        if ('min_length' == $type) {
            $returnVal = is_numeric($vale) && (int) $vale <= (int) static::getUserPassConfig('max_length');
Severity: Minor
Found in modules/Settings/Password/models/Record.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 moduleHandler has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function moduleHandler($moduleName, $eventType)
    {
        if ('module.postinstall' === $eventType) {
            $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
            if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
Severity: Minor
Found in modules/LettersIn/LettersIn.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 deactivate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function deactivate(App\Request $request)
    {
        if ('outlook' === $request->getByType('source')) {
            $security = new \App\ConfigFile('security');
            $security->set('allowedScriptDomains', array_values(array_diff((\Config\Security::$allowedScriptDomains), [
Severity: Minor
Found in modules/Settings/MailIntegration/actions/Activate.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