YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function change has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function change(App\Request $request)
    {
        $moduleName = $request->getModule();
        $viewer = $this->getViewer($request);
        $viewer->assign('WARNING', '');
Severity: Minor
Found in modules/Users/views/PasswordModal.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 getAll has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function &getAll()
    {
        $libs = [];
        foreach (static::$libraries as $name => $lib) {
            $status = 0;
Severity: Minor
Found in modules/Settings/ModuleManager/models/Library.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 getTemplateType has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getTemplateType(Vtiger_PDF_Model $template)
    {
        $matches = [];
        $content = $template->get('body_content');
        preg_match_all(\App\TextParser::VARIABLE_REGEX, $content, $matches, PREG_SET_ORDER);
Severity: Minor
Found in modules/Settings/PDF/models/Module.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 removeField has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function removeField(string $moduleName, string $fieldName)
    {
        $tabId = \App\Module::getModuleId($moduleName);
        $dataReader = (new \App\Db\Query())->select(['id'])->from('s_#__fields_dependency')
            ->orWhere(['and', ['tabid' => $tabId], ['or', ['like', 'fields', "\"{$fieldName}\""], ['like', 'conditionsFields', "\"{$fieldName}\""]]])
Severity: Minor
Found in modules/Settings/FieldsDependency/models/Module.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 getFieldInstanceByName has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        $moduleName = $this->getModule()->getName(true);
        $fieldsLabel = $this->getEditFields();
        $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
Severity: Minor
Found in modules/Settings/WebserviceUsers/services/ManageConsents.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 save has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function save(App\Request $request)
    {
        $blockId = $request->get('blockid');
        $sourceModule = $request->getByType('sourceModule', 2);
        $modueInstance = Vtiger_Module_Model::getInstance($sourceModule);
Severity: Minor
Found in modules/Settings/LayoutEditor/actions/Block.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 copyMenu has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function copyMenu($fromRole, $toRole, $roleId)
    {
        $db = \App\Db::getInstance();
        $menuData = (new \App\Db\Query())->from('yetiforce_menu')
            ->where(['role' => $fromRole])
Severity: Minor
Found in modules/Settings/Menu/models/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 updateActionsSequence has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function updateActionsSequence(int $wfIdToMove, int $workflowBeforeId, string $moduleName): void
    {
        if ($workflowBeforeId !== $wfIdToMove) {
            $db = \App\Db::getInstance();
            $caseSequence = 'CASE';
Severity: Minor
Found in modules/Settings/Workflows/models/Module.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 updateSmtp has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateSmtp(App\Request $request)
    {
        $encryptInstance = \App\Encryption::getInstance();
        $data = [
            'mailer_type' => $request->getByType('mailer_type'),
Severity: Minor
Found in modules/Settings/MailSmtp/actions/SaveAjax.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 getValuesForSave has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getValuesForSave(): array
    {
        $forSave = [];
        $tableName = $this->getModule()->baseTable;

Severity: Minor
Found in modules/Settings/PickListDependency/models/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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $targetFile = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . 'layouts' . DIRECTORY_SEPARATOR . 'resources' . DIRECTORY_SEPARATOR . 'Logo' . DIRECTORY_SEPARATOR . 'logo';
        $response = new Vtiger_Response();
        $result = ['success' => false, 'message' => \App\Language::translate('LBL_UPLOAD_ERROR', $request->getModule(false))];
Severity: Minor
Found in modules/Settings/Roles/actions/UploadLogo.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 getRecordModelFromRequest has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    protected function getRecordModelFromRequest(App\Request $request)
    {
        if ($request->isEmpty('record')) {
            $recordModel = Settings_PickListDependency_Record_Model::getCleanInstance();
            foreach (['tabid', 'source_field'] as $fieldName) {
Severity: Minor
Found in modules/Settings/PickListDependency/actions/SaveAjax.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(OSSMail_Mail_Model $mail)
    {
        $this->mail = $mail;
        $id = $recordId = 0;
        $this->prefix = \App\Mail\RecordFinder::getRecordNumberFromString($mail->get('subject'), 'HelpDesk');
Severity: Minor
Found in modules/OSSMailScanner/scanneractions/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 checkExistingRbl has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    private function checkExistingRbl(App\Request $request): string
    {
        $rblRecord = \App\Mail\Rbl::getRequestById($request->getInteger('record'));
        $rblRecord->parse();
        $sender = $rblRecord->getSender();
Severity: Minor
Found in modules/Settings/MailRbl/actions/SaveAjax.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 setDataFromRequest has a Cognitive Complexity of 10 (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/Groups/models/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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $supportedModules = Settings_RecordNumbering_Module_Model::getSupportedModules();
        $sourceModule = $request->getByType('sourceModule', 2);
        $valueParam = $request->getByType('picklist', \App\Purifier::TEXT);
Severity: Minor
Found in modules/Settings/RecordNumbering/views/Advanced.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 showFieldLayout has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function showFieldLayout(App\Request $request)
    {
        $sourceModule = $request->getByType('sourceModule', 2);
        $menuModelsList = \App\Module::getQuickCreateModules();

Severity: Minor
Found in modules/Settings/QuickCreateEditor/views/Index.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 encryption has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function encryption(App\Request $request)
    {
        $method = $request->isEmpty('methods') ? '' : $request->getByType('methods', 'Text');
        $vector = $request->getRaw('vector');
        $pass = $request->getRaw('password');
Severity: Minor
Found in modules/Settings/Password/actions/Save.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 getCustomViewList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCustomViewList()
    {
        $filters = (new \App\Db\Query())->select(['cvid', 'viewname', 'entitytype', 'vtiger_tab.tabid'])
            ->from('vtiger_customview')
            ->leftJoin('vtiger_tab', 'vtiger_tab.name = vtiger_customview.entitytype')->all();
Severity: Minor
Found in modules/Settings/Menu/models/Module.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 loadLangTranslation has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function loadLangTranslation($langs, $moduleName)
    {
        $keysPhp = $keysJs = $langTab = $respPhp = $respJs = [];
        $moduleName = str_replace(self::URL_SEPARATOR, DIRECTORY_SEPARATOR, $moduleName);
        if (!\is_array($langs)) {
Severity: Minor
Found in modules/Settings/LangManagement/models/Module.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