YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method showRecentActivities has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function showRecentActivities(App\Request $request)
    {
        $moduleName = $request->getModule();
        include_once 'modules/ModTracker/ModTracker.php';
        $type = 'changes';
Severity: Major
Found in modules/Vtiger/views/Detail.php - About 2 hrs to fix

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

        public function process(App\Request $request, $widget = null)
        {
            $viewer = $this->getViewer($request);
            $moduleName = $request->getModule();
            $data = $request->getAll();
    Severity: Major
    Found in modules/Vtiger/dashboards/MiniList.php - About 2 hrs to fix

      Function registerSwitchEvents has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          registerSwitchEvents() {
              let isWorkDays,
                  switchShowTypeVal,
                  switchContainer = $('.js-calendar__tab--filters'),
                  switchShowType = switchContainer.find('.js-switch--showType'),
      Severity: Minor
      Found in public_html/layouts/basic/modules/Vtiger/resources/CalendarView.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 registerAjaxParams has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

              registerAjaxParams(selectElement, params) {
                  params.tags = false;
                  params.language.searching = function () {
                      return app.vtranslate('JS_SEARCHING');
                  };
      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 getPageController has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          getPageController: function () {
              if (window.pageController) {
                  return window.pageController;
              }
              const moduleName = app.getModuleName();
      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 testGetGeneralVariable has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function testGetGeneralVariable()
          {
              $arr = \App\TextParser::getInstance('IStorages')->getGeneralVariable();
              $this->assertIsArray($arr, 'Expected array type');
              $this->assertNotEmpty($arr, 'Expected any general variables data');
      Severity: Minor
      Found in tests/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 export has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function export()
          {
              $timings = [];
              $stack = [];
              foreach ($this->messages as $i => $log) {
      Severity: Minor
      Found in app/Log/Profiling.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 getFieldPermission has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getFieldPermission($tabMix, $fieldMix, $readOnly = true)
          {
              $tabId = $tabMix;
              if (!is_numeric($tabMix)) {
                  $tabId = Module::getModuleId($tabMix);
      Severity: Minor
      Found in app/Field.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 getYarnLibraries has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getYarnLibraries(string $integrityFile, string $srcDir): array
          {
              $libraries = [];
              if (file_exists($integrityFile)) {
                  $yarnFile = \App\Json::decode(file_get_contents($integrityFile), true);
      Severity: Minor
      Found in app/Installer/Credits.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 getMenuHeaderLinks has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function getMenuHeaderLinks(\App\Request $request): array
          {
              $userModel = \App\User::getCurrentUserModel();
              $headerLinks = $headerLinkInstances = [];
      
      
      Severity: Minor
      Found in app/Controller/View/Page.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 getFooterScripts has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getFooterScripts(\App\Request $request)
          {
              $moduleName = $request->getModule();
              $jsFileNames = [
                  'modules.Vtiger.resources.Menu',
      Severity: Minor
      Found in app/Controller/View/Page.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 calculate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function calculate()
          {
              $product = \App\YetiForce\Register::getProduct('YetiForceMap');
              if (!\App\RequestUtil::isNetConnection() || ((empty($product['params']['login']) || empty($product['params']['pass'])) && empty($product['params']['token']))) {
                  throw new \App\Exceptions\AppException('ERR_NO_INTERNET_CONNECTION');
      Severity: Minor
      Found in app/Map/Routing/YetiForce.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 showHelp has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          private function showHelp(): void
          {
              if ($this->climate->arguments->defined('module')) {
                  $module = $this->climate->arguments->get('module');
                  $className = "\\App\\Cli\\{$module}";
      Severity: Minor
      Found in app/Cli.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 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getByModule(string $moduleName, ?bool $onlyActive = false, ?string $relatedModuleName = null): array
          {
              if (Cache::has('App\Relation::getByModule', $moduleName)) {
                  $allRelations = Cache::get('App\Relation::getByModule', $moduleName);
              } else {
      Severity: Minor
      Found in app/Relation.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 loadFromContent has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function loadFromContent(string $contents, $name = false, array $param = [])
          {
              if (empty($contents)) {
                  Log::warning("Empty content, unable to create file: $name | Size: " . \strlen($contents), __CLASS__);
                  return false;
      Severity: Minor
      Found in app/Fields/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

      Function getChildModules has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getChildModules($moduleName, $hierarchy = [1])
          {
              $modules = [];
              switch (static::getModuleLevel($moduleName)) {
                  case 0:
      Severity: Minor
      Found in app/ModuleHierarchy.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 getLabel has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function getLabel($mixedId)
          {
              $multiMode = \is_array($mixedId);
              $ids = $multiMode ? $mixedId : [$mixedId];
              $missing = [];
      Severity: Minor
      Found in app/Fields/Owner.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 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function process(): int
          {
              $query = (new \App\Db\Query())->select([
                  'ID_DOKUMENTU_HANDLOWEGO', 'ID_FIRMY', 'ID_KONTRAHENTA', 'ID_DOK_ORYGINALNEGO',
                  'NUMER', 'FORMA_PLATNOSCI', 'UWAGI', 'KONTRAHENT_NAZWA', 'WARTOSC_NETTO', 'WARTOSC_BRUTTO', 'DOK_KOREKTY', 'DATA_KURS_WAL', 'DOK_WAL', 'SYM_WAL',
      Severity: Minor
      Found in app/Integrations/Wapro/Synchronizer/Invoice.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 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function process(): int
          {
              $query = (new \App\Db\Query())->from('dbo.KONTAKT');
              $pauser = \App\Pauser::getInstance('WaproContactsLastId');
              if ($val = $pauser->getValue()) {
      Severity: Minor
      Found in app/Integrations/Wapro/Synchronizer/Contacts.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 16 (exceeds 5 allowed). Consider refactoring.
      Open

          public function process(): int
          {
              $query = (new \App\Db\Query())->from('dbo.KONTRAHENT');
              $pauser = \App\Pauser::getInstance('WaproAccountLastId');
              if ($val = $pauser->getValue()) {
      Severity: Minor
      Found in app/Integrations/Wapro/Synchronizer/Accounts.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