YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method getFieldInstanceByName has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName(string $name)
    {
        $params = [];
        $qualifiedModuleName = 'Settings:TreesManager';
        switch ($name) {
Severity: Major
Found in modules/Settings/TreesManager/models/Record.php - About 2 hrs to fix

    Method saveLocks has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function saveLocks($data)
        {
            $oldValues = $this->getLocks();
            $map = $toSave = [];
            if (!empty($data)) {
    Severity: Major
    Found in modules/Settings/Users/models/Module.php - About 2 hrs to fix

      Method getRecordListViewLinksLeftSide has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getRecordListViewLinksLeftSide()
          {
              $links = $recordLinks = [];
              if ($this->isViewable()) {
                  $recordLinks['LBL_SHOW_COMPLETE_DETAILS'] = [
      Severity: Major
      Found in modules/Users/models/Record.php - About 2 hrs to fix

        Method getRates has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getRates($otherCurrencyCode, $dateParam, $cron = false)
            {
                $moduleModel = Settings_CurrencyUpdate_Module_Model::getCleanInstance();
                $selectedBank = $moduleModel->getActiveBankId();
                $yesterday = date('Y-m-d', strtotime('-1 day'));
        Severity: Major
        Found in modules/Settings/CurrencyUpdate/bankmodels/CBR.php - About 2 hrs to fix

          Method getDisplayValue has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getDisplayValue(string $key)
              {
                  $value = $this->get($key);
                  switch ($key) {
                      case 'smtp_id':
          Severity: Major
          Found in modules/Settings/Mail/models/Record.php - About 2 hrs to fix

            Method doTask has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function doTask($recordModel)
                {
                    $fieldValueMapping = [];
                    if (!empty($this->field_value_mapping)) {
                        $fieldValueMapping = \App\Json::decode($this->field_value_mapping);
            Severity: Major
            Found in modules/com_vtiger_workflow/tasks/VTUpdateRelatedFieldTask.php - About 2 hrs to fix

              Method getListViewMassActions has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getListViewMassActions($linkParams)
                  {
                      $currentUserModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                      $moduleModel = $this->getModule();
                      $massActionLinks = [];
              Severity: Major
              Found in modules/OSSMailView/models/ListView.php - About 2 hrs to fix

                Method getRangeValues has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getRangeValues()
                    {
                        $uiTypeModel = $this->getUITypeModel();
                        if (method_exists($uiTypeModel, 'getRangeValues')) {
                            return $uiTypeModel->getRangeValues();
                Severity: Major
                Found in modules/Vtiger/models/Field.php - About 2 hrs to fix

                  Method post has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function post(): array
                      {
                          if ($result = $this->checkBeforeSave()) {
                              return $result;
                          }
                  Severity: Major
                  Found in api/webservice/WebservicePremium/BaseModule/SaveInventory.php - About 2 hrs to fix

                    Function importFont has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function importFont($zipfile)
                        {
                            $fontsDir = ROOT_DIRECTORY . '/public_html/layouts/resources/fonts';
                            $zip = \App\Zip::openFile($zipfile, ['onlyExtensions' => ['ttf', 'txt', 'woff']]);
                            $files = $zip->unzip(['fonts' => $fontsDir]);
                    Severity: Minor
                    Found in vtlib/Vtiger/PackageImport.php - About 2 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 __convertToUserFormat has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function __convertToUserFormat($date, $format)
                        {
                            \App\Log::trace('Start ' . __METHOD__ . ' ' . serialize($date) . ' | ' . $format);
                            if (!\is_array($date)) {
                                $date = explode(' ', $date);
                    Severity: Minor
                    Found in include/fields/DateTimeField.php - About 2 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 setUpdater has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function setUpdater($moduleName, $record = false, $priority = false, $type = 1)
                        {
                            $params = [
                                'module' => $moduleName,
                                'type' => $type,
                    Severity: Minor
                    Found in app/PrivilegeUpdater.php - About 2 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 getTemplatePath has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function getTemplatePath($templateName, $moduleName = ''): string
                        {
                            $moduleName = str_replace(':', '/', $moduleName);
                            $cacheKey = $templateName . $moduleName;
                            if (\App\Cache::has('ViewerTemplatePath', $cacheKey)) {
                    Severity: Minor
                    Found in include/runtime/Viewer.php - About 2 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 createUserPrivilegesfile has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function createUserPrivilegesfile($userid)
                        {
                            $fileUserPrivileges = ROOT_DIRECTORY . \DIRECTORY_SEPARATOR . 'user_privileges/user_privileges_' . $userid . '.php';
                            $handle = fopen($fileUserPrivileges, 'w+');
                            if ($handle) {
                    Severity: Minor
                    Found in app/UserPrivilegesFile.php - About 2 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 relatedRecordsListPrinter has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function relatedRecordsListPrinter(\Vtiger_RelationListView_Model $relationListView, \Vtiger_Paging_Model $pagingModel, int $maxLength): string
                        {
                            $relatedModuleName = $relationListView->getRelationModel()->getRelationModuleName();
                            $rows = $headers = '';
                            $fields = $relationListView->getRelationModel()->getQueryFields();
                    Severity: Minor
                    Found in app/TextParser.php - About 2 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 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function process()
                        {
                            $data = [];
                            [$relationId, $fields, $conditions, $limit, $orderBy, $relConditions] = array_pad($this->params, 6, '');
                            if (is_numeric($relationId)) {
                    Severity: Minor
                    Found in app/TextParser/RelatedRecordsData.php - About 2 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 updateLabelOnSave has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function updateLabelOnSave(\Vtiger_Record_Model $recordModel): void
                        {
                            $label = '';
                            $metaInfo = \App\Module::getEntityInfo($recordModel->getModuleName());
                            $dbCommand = Db::getInstance()->createCommand();
                    Severity: Minor
                    Found in app/Record.php - About 2 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 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function process()
                        {
                            if (!$this->textParser->recordModel || !$this->textParser->recordModel->getModule()->isInventory()) {
                                return '';
                            }
                    Severity: Minor
                    Found in app/TextParser/TableCurrencySTwoLang.php - About 2 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 parse has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private function parse($rows)
                        {
                            $address = [];
                            foreach ($rows as $row) {
                                switch ($row['types'][0]) {
                    Severity: Minor
                    Found in app/Map/Address/GoogleGeocode.php - About 2 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 cpu has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private static function cpu(): array
                        {
                            $mathFunctions = self::$mathFunctions;
                            $mathCountGroup = 5000;
                            $mathMaxTime = 0.3;
                    Severity: Minor
                    Found in app/Utils/Benchmarks.php - About 2 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