YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method updateRecords has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function updateRecords()
    {
        if ($this->isEmpty('id')) {
            return [];
        }
Severity: Major
Found in app/Fields/RecordNumber.php - About 2 hrs to fix

    Method recordSaveAttendee has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function recordSaveAttendee(\Vtiger_Record_Model $record)
        {
            if ('VEVENT' === (string) $this->vcomponent->name) {
                $invities = $this->getInvitations($record->getId());
                $time = VObject\DateTimeParser::parse($this->vcomponent->DTSTAMP);
    Severity: Major
    Found in app/Integrations/Dav/Calendar.php - About 2 hrs to fix

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

          public function process(App\Request $request)
          {
              \App\Log::trace('Start ' . __METHOD__);
              $qualifiedModule = $request->getModule(false);
              $viewer = $this->getViewer($request);
      Severity: Major
      Found in modules/Settings/PDF/views/Import.php - About 2 hrs to fix

        Method getQuery has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function getQuery($filter)
            {
                $request = \App\Request::init();
                if ($this->getExtraData('relation_id') && $this->getExtraData('recordId')) {
                    $relationModelInstance = Vtiger_Relation_Model::getInstanceById($this->getExtraData('relation_id'));
        Severity: Major
        Found in modules/Vtiger/models/ChartFilter.php - About 2 hrs to fix

          Method uploadAndParse has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function uploadAndParse(App\Request $request)
              {
                  if (Import_Utils_Helper::validateFileUpload($request)) {
                      $user = App\User::getCurrentUserModel();
                      $fileReader = Import_Module_Model::getFileReader($request, $user);
          Severity: Major
          Found in modules/Vtiger/views/Import.php - About 2 hrs to fix

            Method get has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function get(): array
                {
                    $displayData = $fieldsLabel = [];
                    $moduleName = $this->controller->request->get('module');
                    $setRawData = 1 === (int) ($this->controller->headers['x-raw-data'] ?? 0);
            Severity: Major
            Found in api/webservice/WebserviceStandard/BaseModule/Record.php - About 2 hrs to fix

              Function validate has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                      validate: function () {
                          let response = this._super();
                          if (response != true) {
                              return response;
                          }
              Severity: Minor
              Found in public_html/layouts/resources/validator/FieldValidator.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 mergeDeepReactive has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

              export function mergeDeepReactive(target, ...sources) {
                  if (!sources.length) {
                      return Vue.observable(target)
                  }
                  const isObject = (item) => {
              Severity: Minor
              Found in public_html/src/layouts/basic/modules/Chat/utils/utils.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 formatToHourText has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  formatToHourText: function (decTime, type = 'short', withSeconds = false, withMinutes = true) {
                      const short = type === 'short';
                      const hour = Math.floor(decTime);
                      const min = Math.floor((decTime - hour) * 60);
                      const sec = Math.round(((decTime - hour) * 60 - min) * 60);
              Severity: Minor
              Found in public_html/layouts/resources/app.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 handleMigration has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function handleMigration($modulenode, $moduleInstance)
                  {
                      $this->parseMigration($modulenode);
                      $cur_version = $moduleInstance->version;
                      foreach ($this->_migrations as $migversion => $migrationnode) {
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 updateField has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function updateField($blocknode, $blockInstance, $moduleInstance, $fieldnode, $fieldInstance)
                  {
                      // strval used because in $fieldnode there is a SimpleXMLElement object
                      $fieldInstance->name = (string) ($fieldnode->fieldname);
                      $fieldInstance->label = (string) ($fieldnode->fieldlabel);
              Severity: Minor
              Found in vtlib/Vtiger/PackageUpdate.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 getByModule has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getByModule(int $tabId, ?int $gui = null): array
                  {
                      if (Cache::has('FieldsDependency', $tabId)) {
                          $fields = Cache::get('FieldsDependency', $tabId);
                      } else {
              Severity: Minor
              Found in app/FieldsDependency.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 clearTemporaryFiles has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function clearTemporaryFiles(string $days = '-30 day'): array
                  {
                      $time = strtotime($days);
                      $exclusion = ['.htaccess', 'index.html'];
                      $s = $i = 0;
              Severity: Minor
              Found in app/Cache.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 getParent has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getParent(int $record, string $moduleName): ?array
                  {
                      if (0 === \App\ModuleHierarchy::getModuleLevel($moduleName)) {
                          return ['id' => $record, 'moduleName' => $moduleName];
                      }
              Severity: Minor
              Found in app/Components/InterestsConflict.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 view has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function view($templateName, $moduleName = '', $fetch = false)
                  {
                      $templatePath = $this->getTemplatePath($templateName, $moduleName);
                      if (\App\Cache::has('ViewerTemplateExists', $templatePath)) {
                          $templateFound = \App\Cache::get('ViewerTemplateExists', $templatePath);
              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 getConditions has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getConditions($id): array
                  {
                      if (Cache::has('CustomView_GetConditions', $id)) {
                          return Cache::get('CustomView_GetConditions', $id);
                      }
              Severity: Minor
              Found in app/CustomView.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 updateList has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function updateList(int $record): int
                  {
                      $sender = $this->getSender();
                      $return = 0;
                      if (!empty($sender['ip'])) {
              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 getReceived has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getReceived(): array
                  {
                      $rows = [];
                      foreach ($this->mailMimeParser->getAllHeadersByName('Received') as $key => $received) {
                          $row = ['key' => $key, 'fromIP' => $received->getFromAddress() ?? ''];
              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 getById has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function getById($crmId)
                  {
                      $values = [];
                      if (\is_array($crmId)) {
                          foreach ($crmId as $id) {
              Severity: Minor
              Found in app/Fields/SharedOwner.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 clean has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function clean()
                  {
                      $time = microtime(true);
                      $lifeTime = \Config\Security::$maxLifetimeSession;
                      $exclusion = ['.htaccess', 'index.html', 'sess_' . session_id()];
              Severity: Minor
              Found in app/Session/File.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