YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Function parseConditions has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in app/TextParser/RecordsList.php - About 5 hrs 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 getAddressFieldValue has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function getAddressFieldValue(string $type, string $fieldNameCrm, string $fieldName)
    {
        $methodName = 'getCrm' . \ucfirst($fieldNameCrm);
        if (!empty($fieldParsed = $this->getAddressDataByType($type))) {
            if (\method_exists($this, $methodName)) {
Severity: Minor
Found in app/Integrations/Magento/Synchronizer/Maps/Base.php - About 5 hrs 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 baseModuleTools has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public static function baseModuleTools(): int
    {
        $i = 0;
        $allUtility = $missing = $curentProfile2utility = [];
        foreach ((new \App\Db\Query())->from('vtiger_profile2utility')->all() as $row) {
Severity: Minor
Found in app/Db/Fixer.php - About 5 hrs 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 addTables has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function addTables(Base $importer)
    {
        $this->logs .= "> start add tables ({$importer->dbType})\n";
        $startMain = microtime(true);
        foreach ($importer->tables as $tableName => $table) {
Severity: Minor
Found in app/Db/Importer.php - About 5 hrs 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 transferListSearchParamsToFilterCondition has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function transferListSearchParamsToFilterCondition($searchParams, Settings_Vtiger_Module_Model $moduleModel)
    {
        if (empty($searchParams)) {
            return [];
        }
Severity: Minor
Found in modules/Settings/Vtiger/views/Pagination.php - About 5 hrs 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 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        \App\Log::trace('Start ' . __METHOD__);
        $qualifiedModule = $request->getModule(false);
        $viewer = $this->getViewer($request);
Severity: Minor
Found in modules/Settings/Workflows/views/Import.php - About 5 hrs 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 getCalendarActivities has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCalendarActivities($mode, Vtiger_Paging_Model $pagingModel, $user, $recordId = false, $paramsMore = [])
    {
        $activities = [];
        $query = new \App\Db\Query();
        if (!$user) {
Severity: Minor
Found in modules/Home/models/Module.php - About 5 hrs 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 getExternalUrlForWidget has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getExternalUrlForWidget($record, $type, $srecord = false, $smoduleName = false)
    {
        if (\is_object($record)) {
            $body = $record->get('content');
            $subject = $record->get('subject');
Severity: Minor
Found in modules/OSSMail/models/Module.php - About 5 hrs 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 unfoldFlowed has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function unfoldFlowed(string $text, bool $delSp = false): string
    {
        $text = preg_split('/\r?\n/', $text);
        $last = -1;
        $qLevel = 0;
Severity: Minor
Found in modules/OSSMail/models/Record.php - About 5 hrs 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 getWidgetTimeControl has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function getWidgetTimeControl($user, $date)
    {
        if (!$date) {
            return ['show_chart' => false];
        }
Severity: Minor
Found in modules/OSSTimeControl/dashboards/TimeControl.php - About 5 hrs 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 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $recordId = $request->getInteger('record');
Severity: Minor
Found in modules/Vtiger/views/Edit.php - About 5 hrs 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 showRelatedList has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function showRelatedList(App\Request $request)
    {
        $moduleName = $request->getModule();
        $relatedModuleName = $request->getByType('relatedModule', 2);
        $parentId = $request->getInteger('record');
Severity: Minor
Found in modules/PriceBooks/views/Detail.php - About 5 hrs 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 send has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    public function send()
    {
        $encryptDataTransfer = \App\Config::api('ENCRYPT_DATA_TRANSFER') ? 1 : 0;
        if (200 !== $this->status || 'data' !== $this->responseType) {
            $encryptDataTransfer = 0;
Severity: Minor
Found in api/webservice/Core/Response.php - About 5 hrs 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

Method __vtlibGetModulevarValue has 125 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function __vtlibGetModulevarValue($module, $varname)
    {
        $mod_var_mapping = [
            'Accounts' => [
                'IsCustomModule' => false,
Severity: Major
Found in include/utils/VtlibUtils.php - About 5 hrs to fix

    ModTracker_Record_Model has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ModTracker_Record_Model extends Vtiger_Record_Model
    {
        const UPDATE = 0;
        const DELETE = 1;
        const CREATE = 2;
    Severity: Minor
    Found in modules/ModTracker/models/Record.php - About 5 hrs to fix

      Method operationsAfterPicklistDelete has 124 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function operationsAfterPicklistDelete($entityData)
          {
              $dbCommand = App\Db::getInstance()->createCommand();
              $pickListFieldName = $entityData['fieldname'];
              $valueToDelete = $entityData['valuetodelete'];
      Severity: Major
      Found in modules/Settings/Picklist/handlers/PickListHandler.php - About 4 hrs to fix

        Function getValues has 123 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                getValues: function () {
                    const thisInstance = this;
                    let fieldList = ['columnname', 'comparator', 'value', 'column_condition'],
                        filterContainer = this.getFilterContainer(),
                        conditionGroups = $('.conditionGroup', filterContainer),
        Severity: Major
        Found in public_html/layouts/basic/modules/Vtiger/resources/AdvanceFilter.js - About 4 hrs to fix

          Method getRelatedModuleSharingArray has 123 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function getRelatedModuleSharingArray($par_mod, $share_mod, $mod_sharingrule_members, $mod_share_read_per, $mod_share_write_per, $def_org_share)
              {
                  $relatedModSharingPermission = [];
                  $modShareReadPermission = [];
                  $modShareWritePermission = [];
          Severity: Major
          Found in app/UserPrivilegesFile.php - About 4 hrs to fix

            Method saveModulePermissions has 123 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function saveModulePermissions($moduleModel, $permissions)
                {
                    $db = \App\Db::getInstance();
                    $dbCommand = $db->createCommand();
                    $profileId = $this->getId();
            Severity: Major
            Found in modules/Settings/Profiles/models/Record.php - About 4 hrs to fix

              Function record has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function record($params, $isPermitted = true)
                  {
                      if (!isset($this->recordModel) || ($isPermitted && !Privilege::isPermitted($this->moduleName, 'DetailView', $this->record))) {
                          return '';
                      }
              Severity: Minor
              Found in app/TextParser.php - About 4 hrs 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