Skip to content

Profiles extract enhancements - #1710

Open
nvuillam wants to merge 5 commits into
mainfrom
fix/profile-extract
Open

Profiles extract enhancements#1710
nvuillam wants to merge 5 commits into
mainfrom
fix/profile-extract

Conversation

@nvuillam

Copy link
Copy Markdown
Member
  • hardis:project:clean:profiles-extract:
    • Added support for filtering SObjects with qualified names.
    • Updated CSV generation functions to skip WebSocket notifications.
    • Enhanced error handling and logging for bulk queries.
    • Implemented concurrent processing for fetching object fields.
    • Sort items in XLSX

- Added support for filtering SObjects with qualified names.
- Improved logging with color-coded messages for better visibility.
- Updated CSV generation functions to skip WebSocket notifications.
- Enhanced error handling and logging for bulk queries.
- Implemented concurrent processing for fetching object fields.
@github-actions

github-actions Bot commented Feb 10, 2026

Copy link
Copy Markdown

MegaLinter analysis: Error

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 8 0 0 0.19s
✅ BASH shfmt 3 0 0 0 0.98s
❌ COPYPASTE jscpd yes 1 no 19.55s
✅ DOCKERFILE hadolint 1 0 0 0.12s
✅ JSON v8r 27 0 0 12.12s
✅ MARKDOWN markdown-table-formatter 342 0 0 0 1.48s
✅ REPOSITORY checkov yes no no 25.27s
⚠️ REPOSITORY gitleaks yes 5 no 163.29s
⚠️ REPOSITORY grype yes 1 no 78.56s
✅ REPOSITORY trivy yes no no 19.3s
✅ REPOSITORY trufflehog yes no no 8.98s
❌ SPELL cspell 681 1 0 18.32s
⚠️ SPELL lychee 386 93 0 9.98s
✅ TYPESCRIPT eslint 280 0 0 0 11.43s
✅ YAML v8r 15 0 0 4.91s

Detailed Issues

❌ SPELL / cspell - 1 error
src/commands/hardis/project/clean/profiles-extract.ts:562:23    - Unknown word (permissionable) -- if (field.permissionable === false) {
	 Suggestions: [permissible]
CSpell: Files checked: 659, Issues found: 1 in 1 file.


You can skip this misspellings by defining the following .cspell.json file at the root of your repository
Of course, please correct real typos before :)

{
    "version": "0.2",
    "language": "en",
    "ignorePaths": [
        "**/node_modules/**",
        "**/vscode-extension/**",
        "**/.git/**",
        "**/.pnpm-lock.json",
        ".vscode",
        "package-lock.json",
        "megalinter-reports"
    ],
    "words": [
        "permissionable"
    ]
}


You can also copy-paste megalinter-reports/.cspell.json at the root of your repository

🤖 AI-Powered Fix Suggestions for SPELL_CSPELL (by google gemini-2.5-flash)

1. Main Issue:
An unknown word, permissionable, was found in src/commands/hardis/project/clean/profiles-extract.ts at line 562.

2. Explanation & Why it occurs:
cspell is a spell checker that flags words not present in its configured dictionaries. permissionable is not recognized, likely because it's either a typo (the linter suggests permissible) or a specific technical/domain-specific term not included in standard dictionaries.

3. How to Fix:
You have two primary, actionable solutions:

  • Correct the typo: If permissible is the intended word, update your code:
    // Original: if (field.permissionable === false) {
    // Fix:
    if (field.permissible === false) {
  • Add to dictionary: If permissionable is an intentional and correct word (e.g., a specific technical term relevant to your project), add it to your cspell.json configuration file under the words array:
    // .cspell.json
    {
      "words": [
        "permissionable"
      ]
    }

Choose the option that accurately reflects the intended usage of the word.

❌ COPYPASTE / jscpd - 1 error
Clone found (typescript):
 - src/commands/hardis/project/clean/profiles-extract.ts [179:2 - 184:6] (5 lines, 106 tokens)
   src/commands/hardis/project/clean/profiles-extract.ts [147:2 - 153:4]

┌────────────┬────────────────┬─────────────┬──────────────┬──────────────┬──────────────────┬───────────────────┐
│ Format     │ Files analyzed │ Total lines │ Total tokens │ Clones found │ Duplicated lines │ Duplicated tokens │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ typescript │ 243            │ 46319       │ 344934       │ 1            │ 5 (0.01%)        │ 106 (0.03%)       │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ javascript │ 8              │ 427         │ 3973         │ 0            │ 0 (0%)           │ 0 (0%)            │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ markdown   │ 5              │ 346         │ 1907         │ 0            │ 0 (0%)           │ 0 (0%)            │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ Total:     │ 256            │ 47092       │ 350814       │ 1            │ 5 (0.01%)        │ 106 (0.03%)       │
└────────────┴────────────────┴─────────────┴──────────────┴──────────────┴──────────────────┴───────────────────┘
Found 1 clones.
HTML report saved to megalinter-reports/copy-paste/html/
ERROR: jscpd found too many duplicates (0.01%) over threshold (0%)
Error: ERROR: jscpd found too many duplicates (0.01%) over threshold (0%)
    at ThresholdReporter.report (/node-deps/node_modules/@jscpd/finder/dist/index.js:615:13)
    at /node-deps/node_modules/@jscpd/finder/dist/index.js:109:18
    at Array.forEach (<anonymous>)
    at /node-deps/node_modules/@jscpd/finder/dist/index.js:108:22
    at async /node-deps/node_modules/jscpd/dist/bin/jscpd.js:9:5

🤖 AI-Powered Fix Suggestions for COPYPASTE_JSCPD (by google gemini-2.5-flash)

  1. Explanation of the error:
    jscpd (JavaScript Copy-Paste Detector) found a duplicate code block within src/commands/hardis/project/clean/profiles-extract.ts. The linter failed because the detected duplication (0.01%) exceeded the configured threshold (0%), meaning any duplication is considered an error.

  2. Why this error occurs:
    This error typically occurs when similar logic is implemented multiple times, often by copying and pasting code. In this specific case, the duplication is within the same file, indicating an opportunity to abstract common functionality into a reusable function or method.

  3. Specific, actionable steps to fix it:

    • Identify Duplication: Open src/commands/hardis/project/clean/profiles-extract.ts and compare lines 179-184 with 147-153.
    • Refactor: Extract the common logic from these two sections into a new, dedicated function or method.
    • Reuse: Replace the duplicated code blocks with calls to your new, reusable function, passing any differing parameters.
    • Threshold (Optional): If minor, unavoidable duplication is acceptable, adjust the jscpd threshold in your .jscpd.json (e.g., to 0.01% or 0.05%) to allow a small percentage of duplicates. Refactoring is generally preferred.
  4. Code example (conceptual fix):

    // Before (conceptual)
    function taskA() { /* common code */ /* A-specific */ }
    function taskB() { /* common code */ /* B-specific */ }
    
    // After
    function sharedLogic(param: any) {
      // ... common code from taskA and taskB ...
      return result;
    }
    
    function taskA() {
      const commonResult = sharedLogic(valueA);
      // A-specific logic using commonResult
    }
    
    function taskB() {
      const commonResult = sharedLogic(valueB);
      // B-specific logic using commonResult
    }
⚠️ REPOSITORY / gitleaks - 5 errors
○
    │╲
    │ ○
    ○ ░
    ░    gitleaks

Finding:     ...BASIC_AUTH_PASSWORD=REDACTED
Secret:      REDACTED
RuleID:      grafana-cloud-api-token
Entropy:     5.345851
File:        salesforce-ci-cd-setup-integration-api/index.html
Line:        12402
Commit:      HIDDEN_BY_MEGALINTERAuthor:      
Email:       
Date:        2026-02-16T15:45:38Z
Fingerprint: 2f710bcd2baa121c9f51fe4781d561694316674f:salesforce-ci-cd-setup-integration-api/index.html:grafana-cloud-api-token:12402
Link:        https://github.com/hardisgroupcom/sfdx-hardis/blob/2f710bcd2baa121c9f51fe4781d561694316674f/salesforce-ci-cd-setup-integration-api/index.html#L12402

Finding:     ...BASIC_AUTH_PASSWORD=REDACTED
Secret:      REDACTED
RuleID:      grafana-cloud-api-token
Entropy:     5.345851
File:        salesforce-ci-cd-setup-integration-api/index.html
Line:        12403
Commit:      HIDDEN_BY_MEGALINTERAuthor:      
Email:       
Date:        2026-02-16T15:45:38Z
Fingerprint: 2f710bcd2baa121c9f51fe4781d561694316674f:salesforce-ci-cd-setup-integration-api/index.html:grafana-cloud-api-token:12403
Link:        https://github.com/hardisgroupcom/sfdx-hardis/blob/2f710bcd2baa121c9f51fe4781d561694316674f/salesforce-ci-cd-setup-integration-api/index.html#L12403

Finding:     const AMPLITUDE_TOKEN = 'REDACTED'
Secret:      REDACTED
RuleID:      generic-api-key
Entropy:     3.715018
File:        src/common/analytics.ts
Line:        7
Commit:      HIDDEN_BY_MEGALINTERAuthor:      NicolasVuillamy
Email:       nicolas.vuillamy@gmail.com
Date:        2021-01-31T00:23:50Z
Fingerprint: ca439c204d52687b82fb54e56ed9644d245c79c5:src/common/analytics.ts:generic-api-key:7
Link:        https://github.com/hardisgroupcom/sfdx-hardis/blob/ca439c204d52687b82fb54e56ed9644d245c79c5/src/common/analytics.ts#L7

Finding:     ...BASIC_AUTH_PASSWORD=REDACTED\nNOTIF_API_METRICS_BA...
Secret:      REDACTED
RuleID:      grafana-cloud-api-token
Entropy:     5.345851
File:        search/search_index.json
Line:        1
Commit:      HIDDEN_BY_MEGALINTERAuthor:      
Email:       
Date:        2026-02-16T15:45:38Z
Fingerprint: 2f710bcd2baa121c9f51fe4781d561694316674f:search/search_index.json:grafana-cloud-api-token:1
Link:        https://github.com/hardisgroupcom/sfdx-hardis/blob/2f710bcd2baa121c9f51fe4781d561694316674f/search/search_index.json#L1

Finding:     ...BASIC_AUTH_PASSWORD=REDACTED\nNOTIF_API_METRICS_BA...
Secret:      REDACTED
RuleID:      grafana-cloud-api-token
Entropy:     5.345851
File:        search/search_index.json
Line:        1
Commit:      HIDDEN_BY_MEGALINTERAuthor:      
Email:       
Date:        2026-02-16T15:45:38Z
Fingerprint: 2f710bcd2baa121c9f51fe4781d561694316674f:search/search_index.json:grafana-cloud-api-token:1
Link:        https://github.com/hardisgroupcom/sfdx-hardis/blob/2f710bcd2baa121c9f51fe4781d561694316674f/search/search_index.json#L1

3:52PM INF 2408 commits scanned.
3:52PM INF scanned ~103066128 bytes (103.07 MB) in 2m43s
3:52PM WRN leaks found: 5
⚠️ REPOSITORY / grype - 1 error
[0000]  WARN no explicit name and version provided for directory source, deriving artifact ID from the given path (which is not ideal) from=syft
NAME                       INSTALLED  FIXED IN  TYPE           VULNERABILITY        SEVERITY  EPSS  RISK  
actions/download-artifact  v4         4.1.3     github-action  GHSA-cxww-7g56-2vh6  High      N/A   N/A
[0078] ERROR discovered vulnerabilities at or above the severity threshold
⚠️ SPELL / lychee - 93 errors
[ERROR] file://docs/hardis/project/deploy/sources/dx.md | Cannot find file
[403] https://nicolas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238 | Error (cached)
[403] https://nicolas.vuillamy.fr/reactivate-all-the-sandbox-users-with-invalid-emails-in-3-clicks-2265af4e3a3d | Error (cached)
[404] https://img.youtube.com/vi/sfdx-hardis/0.jpg | Error (cached)
[404] https://www.youtube.com/watch?v=9y5VmmYHuIg | Error (cached)
[403] https://nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac | Error (cached)
[403] https://npmjs.org/package/sfdx-hardis | Error (cached)
[403] https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0 | Error (cached)

Errors in docs/articles-videos.md
[404] https://img.youtube.com/vi/9y5VmmYHuIg/0.jpg | Network error: Not Found
[403] https://medium.com/@dimitrimonge/freeze-unfreeze-users-during-salesforce-deployment-8a1488bf8dd3 | Network error: Forbidden
[404] https://img.youtube.com/vi/sfdx-hardis/0.jpg | Network error: Not Found
[403] https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7 | Network error: Forbidden
[403] https://nicolas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238 | Network error: Forbidden
[404] https://www.youtube.com/watch?v=9y5VmmYHuIg | Network error: Not Found
[403] https://nicolas.vuillamy.fr/reactivate-all-the-sandbox-users-with-invalid-emails-in-3-clicks-2265af4e3a3d | Network error: Forbidden
[403] https://nicolas.vuillamy.fr/how-to-deploy-conga-composer-configuration-using-salesforce-cli-plugins-c2899641f36b | Network error: Forbidden
[403] https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd | Network error: Forbidden
[403] https://nicolas.vuillamy.fr/what-devops-experts-want-to-know-about-salesforce-ci-cd-with-sfdx-hardis-q-a-1f412db34476 | Network error: Forbidden
[403] https://nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac | Network error: Forbidden

Errors in docs/hardis/deploy/start.md
[403] https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0 | Error (cached)

Errors in docs/hardis/org/data/import.md
[403] https://nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac | Error (cached)

Errors in README.md
[403] https://nicolas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238 | Error (cached)
[403] https://nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac | Error (cached)
[403] https://medium.com/@dimitrimonge/freeze-unfreeze-users-during-salesforce-deployment-8a1488bf8dd3 | Network error: Forbidden
[403] https://nicolas.vuillamy.fr/invalid-scope-mine-not-allowed-deploy-your-listviews-anyway-443aceca8ac7 | Error (cached)
[403] https://nicolas.vuillamy.fr/how-to-deploy-conga-composer-configuration-using-salesforce-cli-plugins-c2899641f36b | Network error: Forbidden
[403] https://npmjs.org/package/sfdx-hardis | Network error: Forbidden
[404] https://coffeeforce.pl/dreamin/speaker/nicolas-vuillamy/ | Network error: Not Found
[404] https://www.youtube.com/watch?v=9y5VmmYHuIg | Error (cached)
[404] https://img.youtube.com/vi/9y5VmmYHuIg/0.jpg | Error (cached)
[404] https://img.youtube.com/vi/sfdx-hardis/0.jpg | Network error: Not Found
[403] https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd | Error (cached)
[403] https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0 | Network error: Forbidden
[403] https://nicolas.vuillamy.fr/reactivate-all-the-sandbox-users-with-invalid-emails-in-3-clicks-2265af4e3a3d | Network error: Forbidden

Errors in CHANGELOG.md
[403] https://help.sfdmu.com/full-documentation/advanced-features/delete-from-source | Network error: Forbidden
[403] https://nicolas.vuillamy.fr/handle-salesforce-api-versions-deprecation-like-a-pro-335065f52238 | Error (cached)
[403] https://medium.com/@nicolasvuillamy/how-to-deploy-conga-composer-configuration-using-salesforce-cli-plugins-c2899641f36b | Network error: Forbidden
[404] https://sfdx-hardis.cloudity.com/salesforce-ci-cd-setup-integrations-bitbucket/ | Network error: Not Found
[403] https://www.npmjs.com/package/prompts | Network error: Forbidden
[403] https://www.npmjs.com/package/inquirer | Network error: Forbidden
[404] https://sfdx-hardis.cloudity.com/deployTips/ | Network error: Not Found
[404] https://www.schemastore.org/json/ | Network error: Not Found
[404] https://sfdx-hardis.cloudity.com/hardis/doc/project/deploy/smart/ | Network error: Not Found
[404] https://sfdx-hardis.cloudity.com/hardis/org/configure/auth/ | Network error: Not Found

Errors in config/sfdx-hardis.jsonschema.json
[403] https://some.sharepoint.com/file.xlsx | Network error: Forbidden
[ERROR] https://tickets.mycompany.com/ticket/%7BticketId%7D | Network error: error sending request for url (https://tickets.mycompany.com/ticket/%7BticketId%7D) Maybe a certificate error?
[404] https://myclient.force.com/ | Network error: Not Found

Errors in docs/hardis/project/deploy/quick.md
[403] https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0 | Error (cached)

Errors in docs/hardis/work/save.md
[ERROR] file://docs/hardis/work/$%7BCONSTANTS.DOC_URL_ROOT%7D/hardis/project/clean/references | Cannot find file
[ERROR] file://docs/hardis/work/$%7BCONSTANTS.DOC_URL_ROOT%7D/salesforce-ci-cd-publish-task | Cannot find file

Errors in docs/hardis/project/deploy/validate.md
[403] https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0 | Error (cached)

Errors in docs/hardis/org/files/import.md
[403] https://nicolas.vuillamy.fr/how-to-mass-download-notes-and-attachments-files-from-a-salesforce-org-83a028824afd | Error (cached)

Errors in docs/hardis/deploy/validate.md
[403] https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0 | Error (cached)

Errors in docs/hardis/mdapi/deploy.md
[403] https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0 | Error (cached)

Errors in docs/salesforce-ci-cd-conga.md
[403] https://medium.com/@nicolasvuillamy/how-to-deploy-conga-composer-configuration-using-salesforce-cli-plugins-c2899641f36b | Error (cached)

Errors in docs/hardis/org/refresh/after-refresh.md
[404] https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/ | Network error: Not Found

Errors in docs/hardis/source/push.md
[403] https://nicolas.vuillamy.fr/assisted-solving-of-salesforce-deployments-errors-47f3666a9ed0 | Error (cached)

Errors in docs/hardis/org/refresh/before-refresh.md
[404] https://sfdx-hardis.cloudity.com/salesforce-sandbox-refresh/ | Network error: Not Found

Errors in docs/salesforce-project-doc-generate.md
[ERROR] http://127.0.0.1:8000/ | Network error: error sending request for url (http://127.0.0.1:8000/) Maybe a certificate error?

Errors in docs/events.md
[404] https://coffeeforce.pl/dreamin/speaker/nicolas-vuillamy/ | Network error: Not Found

Errors in GEMINI.md
[ERROR] file:///github/.github/copilot-instructions.md | Cannot find file

Errors in docs/cloudity-consulting-partner.md
[ERROR] file://assets/images/cloudity-logo.jpg | Cannot find file
[ERROR] file://assets/images/cloudity-map.jpg | Cannot find file

Errors in docs/hardis/org/configure/data.md
[403] https://nicolas.vuillamy.fr/how-to-detect-bad-words-in-salesforce-records-using-sfdx-data-loader-and-sfdx-hardis-171db40a9bac | Error (cached)

Errors in docs/salesforce-ci-cd-home.md
[403] https://nicolas.vuillamy.fr/what-devops-experts-want-to-know-about-salesforce-ci-cd-with-sfdx-hardis-q-a-1f412db34476 | Error (cached)

(Truncated to last 8000 characters out of 22452)

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@beta --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,BASH_SHFMT,COPYPASTE_JSCPD,DOCKERFILE_HADOLINT,JSON_V8R,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GITLEAKS,REPOSITORY_GRYPE,REPOSITORY_TRIVY,REPOSITORY_TRUFFLEHOG,SPELL_CSPELL,SPELL_LYCHEE,TYPESCRIPT_ES,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant