YetiForceCompany/YetiForceCRM

View on GitHub

Showing 4,652 of 306,333 total issues

Method findEmail has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function findEmail(int $record, string $module): string
    {
        if (!\App\Record::isExists($record)) {
            return false;
        }
Severity: Minor
Found in modules/OSSMailView/models/Record.php - About 1 hr to fix

    Method getLeadsBySource has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getLeadsBySource($owner, $dateFilter)
        {
            $query = new \App\Db\Query();
            $query->select([
                'leadsourceid' => 'vtiger_leadsource.leadsourceid',
    Severity: Minor
    Found in modules/Leads/dashboards/LeadsBySource.php - About 1 hr to fix

      Method getAccountFieldsForLeadConvert has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getAccountFieldsForLeadConvert()
          {
              $accountsFields = [];
              $moduleName = 'Accounts';
      
      
      Severity: Minor
      Found in modules/Leads/models/Record.php - About 1 hr to fix

        Method getHeaderLinks has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getHeaderLinks(): array
            {
                $links = [];
                $detailUrl = $this->recordModel->getFullDetailViewUrl();
                $editUrl = $this->recordModel->isEditable() ? $this->recordModel->getEditViewUrl() : '';
        Severity: Minor
        Found in modules/Vtiger/models/RecordPopover.php - About 1 hr to fix

          Method getHistory has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getHistory($pagingModel, $type = false)
              {
                  if (empty($type)) {
                      $type = 'all';
                  }
          Severity: Minor
          Found in modules/Vtiger/models/Module.php - About 1 hr to fix

            Method getStructure has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getStructure(Vtiger_Record_Model $recordModel, App\Request $request): array
                {
                    Vtiger_Field_Model::$tabIndexDefaultSeq = 1000;
                    $values = [];
                    $moduleModel = $recordModel->getModule();
            Severity: Minor
            Found in modules/Vtiger/views/QuickEditModal.php - About 1 hr to fix

              Method formatDateDiffInStrings has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function formatDateDiffInStrings($dateTime)
                  {
                      // http://www.php.net/manual/en/datetime.diff.php#101029
                      $seconds = strtotime('now') - strtotime($dateTime);
                      if (0 === $seconds) {
              Severity: Minor
              Found in modules/Vtiger/helpers/Util.php - About 1 hr to fix

                Method setQtyInStock has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function setQtyInStock(string $moduleName, array $data, int $storageId, string $action)
                    {
                        $db = App\Db::getInstance();
                        $qtyInStock = [];
                        foreach ($data as $product) {
                Severity: Minor
                Found in modules/IStorages/models/Module.php - About 1 hr to fix

                  Method readCoordinatesByRecords has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function readCoordinatesByRecords(array $records)
                      {
                          $moduleModel = $this->get('srcModuleModel');
                          $groupByField = $this->get('groupBy');
                          $coordinatesCenter = $this->get('coordinatesCenter');
                  Severity: Minor
                  Found in modules/OpenStreetMap/models/Coordinate.php - About 1 hr to fix

                    Function deleteCustomRule has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                            deleteCustomRule: function (deleteElement) {
                                let deleteUrl = deleteElement.data('url');
                                let currentRow = deleteElement.closest('.js-custom-rule-entries');
                                app.showConfirmModal({
                                    title: app.vtranslate('LBL_DELETE_CONFIRMATION'),

                    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 showStats has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        showStats: function (data, modules) {
                            const thisInstance = this;
                            let container = $('.LangManagement'),
                                html = '<div class="col-md-12"><div class="panel panel-default"><div class="panel-body col-md-12">',
                                langStats = 0,

                    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 registerTileClickEvent has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                            registerTileClickEvent: function (tileContainer) {
                                tileContainer.on('click', '.js-card-body', function (e) {
                                    if ($(e.target).hasClass('js-show-image-preview')) return;
                                    if ($(e.target).closest('div').hasClass('actions')) return;
                                    if ($(e.target).is('button') || $(e.target).parent().is('button')) return;
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Vtiger/resources/Tiles.js - About 1 hr 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 loadData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                            loadData: function () {
                                let orderBy = this.sourceContainer.find('#orderBy').val();
                                orderBy = orderBy ? JSON.parse(orderBy) : [];
                                if (orderBy && Object.keys(orderBy).length) {
                                    let baseOrderBy = this.container.find('.js-base-element');

                    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 registerSplit has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                            registerSplit: function (container) {
                                var rightSplitMaxWidth = (400 / this.windowW) * 100;
                                var splitMinWidth = (25 / this.windowW) * 100;
                                var splitMaxWidth = 100 - splitMinWidth;
                                var listPreview = container.find('.js-detail-preview');
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Vtiger/resources/ListPreview.js - About 1 hr 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 getInstance has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                            getInstance: function () {
                                if (Vtiger_List_Js.listInstance === false) {
                                    let module = app.getModuleName(),
                                        parentModule = app.getParentModuleName(),
                                        moduleClassName,
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Vtiger/resources/List.js - About 1 hr 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 setFieldOptions has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                            setFieldOptions: function (fieldName, options) {
                                const fieldElement = this.getForm().find(`[name="${fieldName}"]`),
                                    fieldInfo = fieldElement.data('fieldinfo');
                                if (fieldElement.is('select') && fieldInfo) {
                                    const val = fieldElement.val() ?? '',
                    Severity: Minor
                    Found in public_html/layouts/basic/modules/Vtiger/resources/Edit.js - About 1 hr 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 changeUrl has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        changeUrl(params) {
                            let fullUrl = '';
                            if (params.data && typeof params.data.historyUrl !== 'undefined') {
                                fullUrl = params.data.historyUrl;
                            }
                    Severity: Minor
                    Found in public_html/layouts/resources/app.js - About 1 hr 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 arrayDiffAssocRecursive has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function arrayDiffAssocRecursive($array1, $array2)
                        {
                            $difference = [];
                            foreach ($array1 as $key => $value) {
                                if (\is_array($value)) {
                    Severity: Minor
                    Found in vtlib/Vtiger/Functions.php - About 1 hr 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 importTables has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function importTables($modulenode)
                        {
                            if (empty($modulenode->tables) || empty($modulenode->tables->table)) {
                                return;
                            }
                    Severity: Minor
                    Found in vtlib/Vtiger/PackageImport.php - About 1 hr 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 setUp has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function setUp(): void
                        {
                            if (\file_exists(self::$testDataPath)) {
                                $this->fileUrl = self::$testDataPath;
                            } elseif (!empty($_SERVER['YETI_TEST_MODULE_KEY'])) {
                    Severity: Minor
                    Found in tests/Base/E_TestModule.php - About 1 hr 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