YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method process has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process()
    {
        $dbCommand = App\Db::getInstance()->createCommand();
        $scannerModel = Vtiger_Record_Model::getCleanInstance('OSSMailScanner');
        $dataReader = (new App\Db\Query())->select([
Severity: Major
Found in modules/OSSMailScanner/crons/Bind.php - About 2 hrs to fix

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

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

      Method getDetailViewLinks has 66 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getDetailViewLinks(array $linkParams): array
          {
              $linkModelList = parent::getDetailViewLinks($linkParams);
              $recordModel = $this->getRecord();
              $moduleName = $recordModel->getModuleName();
      Severity: Major
      Found in modules/Calendar/models/DetailView.php - About 2 hrs to fix

        Function addTimeControl has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                addTimeControl: function (params) {
                    let aDeferred = jQuery.Deferred();
                    let referenceModuleName = 'OSSTimeControl';
                    let parentId = params.recordId;
                    let parentModule = 'HelpDesk';
        Severity: Major
        Found in public_html/layouts/basic/modules/HelpDesk/resources/Edit.js - About 2 hrs to fix

          Function addTimeControl has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  addTimeControl(params, callback = () => {}) {
                      let aDeferred = jQuery.Deferred();
                      let referenceModuleName = 'OSSTimeControl';
                      let parentId = params.recordId;
                      let parentModule = 'HelpDesk';
          Severity: Major
          Found in public_html/layouts/basic/modules/HelpDesk/resources/Detail.js - About 2 hrs to fix

            Method relatedRecord has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function relatedRecord($params)
                {
                    $params = explode('|', $params);
                    $fieldName = array_shift($params);
                    $relatedField = array_shift($params);
            Severity: Major
            Found in app/TextParser.php - About 2 hrs to fix

              Method recalculatePasswords has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function recalculatePasswords(string $method, string $password, string $vector, int $target)
                  {
                      $dbAdmin = \App\Db::getInstance('admin');
                      $decryptInstance = static::getInstance($target);
                      if (!$decryptInstance->getTarget() || ($decryptInstance->get('method') === $method && $decryptInstance->get('vector') === $vector && $decryptInstance->get('pass') === $password)) {
              Severity: Major
              Found in app/Encryptions/Module.php - About 2 hrs to fix

                Method process has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function process(App\Request $request)
                    {
                        $recordId = $request->getInteger('id');
                        $workflowModel = Settings_Workflows_Record_Model::getInstance($recordId);
                        $workflowObject = $workflowModel->getWorkflowObject();
                Severity: Major
                Found in modules/Settings/Workflows/actions/ExportWorkflow.php - About 2 hrs to fix

                  Method read has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function read()
                      {
                          $this->createTable();
                          $fieldMapping = $this->request->get('field_mapping');
                          $inventoryFieldMapping = $this->request->get('inventory_field_mapping');
                  Severity: Major
                  Found in modules/Import/readers/CSVReader.php - About 2 hrs to fix

                    Method getGanttTasks has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function getGanttTasks($projectIds)
                        {
                            $taskTime = 0;
                            $queryGenerator = new App\QueryGenerator('ProjectTask');
                            $queryGenerator->setFields(['id', 'projectid', 'projecttaskname', 'parentid', 'projectmilestoneid', 'projecttaskprogress', 'projecttaskpriority', 'startdate', 'enddate', 'targetenddate', 'sum_time', 'projecttask_no', 'projecttaskstatus', 'estimated_work_time', 'assigned_user_id']);
                    Severity: Major
                    Found in modules/Project/models/Gantt.php - About 2 hrs to fix

                      Function formatToDisplay has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                              formatToDisplay(value, fixed = true, numberOfDecimal = CONFIG.noOfCurrencyDecimals) {
                                  if (!value) {
                                      value = 0;
                                  }
                                  let strDecimal = value.toString().split('.')[1];
                      Severity: Minor
                      Found in public_html/layouts/resources/Fields.js - 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 emit has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function emit()
                          {
                              $contentTypeSent = false;
                              foreach ($this->headers as $header) {
                                  if (!$contentTypeSent && 0 === stripos($header, 'content-type')) {
                      Severity: Minor
                      Found in include/http/Response.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 purify has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function purify($input, $loop = true)
                          {
                              if (empty($input)) {
                                  return $input;
                              }
                      Severity: Minor
                      Found in app/Purifier.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 removeFieldFromCondition has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function removeFieldFromCondition(string $baseModuleName, array $conditions, string $moduleName, string $fieldName): array
                          {
                              if (isset($conditions['rules'])) {
                                  foreach ($conditions['rules'] as $key => &$condition) {
                                      if (isset($condition['condition'])) {
                      Severity: Minor
                      Found in app/Condition.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 findByEmailField has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static function findByEmailField(string $moduleName, array $fields, array $emails): array
                          {
                              $activeFields = $conditions = $return = [];
                              foreach ($emails as $i => $email) {
                                  if (isset(self::$emailsCache[$moduleName][$email])) {
                      Severity: Minor
                      Found in app/Mail/RecordFinder.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 19 (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/TableTaxSTwoLang.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 findIpByName has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function findIpByName(\ZBateson\MailMimeParser\Header\ReceivedHeader $received, string $type): string
                          {
                              $value = $received->getValueFor($type);
                              $pattern = '~\[(IPv[64])?([a-f\d\.\:]+)\]~i';
                              if (preg_match($pattern, $value, $matches)) {
                      Severity: Minor
                      Found in app/Mail/Rbl.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 init has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private static function init(string $type)
                          {
                              if (\App\Config::main('site_URL')) {
                                  static::$crmUrl = \App\Config::main('site_URL');
                              } elseif (isset(\App\Process::$requestMode) && 'Install' === \App\Process::$requestMode) {
                      Severity: Minor
                      Found in app/Utils/ConfReport.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 saveToDb has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function saveToDb(): bool
                          {
                              $db = \App\Db::getInstance();
                              $result = false;
                              $fieldName = $this->fieldModel->getName();
                      Severity: Minor
                      Found in app/Fields/Picklist/Item.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 import has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function import(): bool
                          {
                              $allChecked = false;
                              try {
                                  if ($categories = $this->getCategoriesFromApi()) {
                      Severity: Minor
                      Found in app/Integrations/Magento/Synchronizer/Category.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