Skip to content

Super-linter JSCPD: exclude generated/vendored files (partial, needs refactor decision) - #1

Merged
dmzoneill merged 1 commit into
mainfrom
cursor/fix-super-linter-jscpd
Oct 24, 2026
Merged

dmzoneill merged 1 commit into
mainfrom
cursor/fix-super-linter-jscpd

Conversation

@dmzoneill

Copy link
Copy Markdown
Owner

JSCPD failed at 33.4% (453 clones). This PR is a partial fix: it only excludes generated and vendored files, and JSCPD will still fail.

Excluded via root .ignore, with provenance comments:

  • **/obj/ and **/bin/ are MSBuild/WPF build output, including the *.g.cs/*.g.i.cs files from MarkupCompilePass1.
  • **/*.Designer.cs are Visual Studio resource and settings generator output, all marked <auto-generated>.
  • csharp/prism/Bin/ holds the vendored Microsoft Prism 4 / Unity binaries and XML API docs.
  • report/report/resources/dotcover/ is a generated JetBrains dotCover HTML coverage report. It was the largest single contributor.

Result: locally, jscpd 4.3.0 drops to 16.7% (7197 of 43083 lines), so this is still over the 5% threshold.

What's left is first-party duplication, which needs a refactor:

  • Perl: perl/opt/lgp/client/distribution/*.pm (Ubuntu, Redhat, Fedora, Mint, Centos, Debian, Gentoo) repeat each other heavily and should move into Distribution.pm. ServiceController.pm and PackageManager.pm are duplicated between client and server.
  • C#: LGP.Components.Panels/Plugin.cs, the OrganizationUnitExplorer/ModuleEditor/PolicyEditor xaml.cs code-behind, and the Database provider projects. The prompt's suggested shared database base class falls in this group.

That is roughly 5,000 duplicated lines of untested runtime code. The C# is a WPF solution that can't be built on Linux CI (no build/test pipeline here), and every touched file must also pass perlcritic, dotnet format and the other linters. I'm holding this for David's decision rather than refactoring it blind.

Nothing was deleted, moved or untracked. There are no linter, workflow or VALIDATE_* changes and no suppressions.

@github-actions

Copy link
Copy Markdown
Contributor

Summary

  • Exclusions added: New root .ignore excludes generated/vendored files (**/obj/, **/bin/, **/*.Designer.cs, csharp/prism/Bin/, and the dotCover report) with provenance comments.
  • Impact: JSCPD drops from 33.4% → 16.7% (7,197/43,083 lines), but still remains above the 5% threshold.

Potential Issues

  • Incomplete fix: This is exclusion-only with no code moved, deleted, or refactored. ~5,000 lines of first-party duplication remain.
  • Large refactor ahead: Key targets include consolidating Perl distribution modules into Distribution.pm, deduplicating ServiceController.pm/PackageManager.pm between client/server, and refactoring C# WPF panels and database providers.
  • Tooling constraints: The WPF solution can't be built or tested on Linux CI, and any refactor will need to pass perlcritic, dotnet format, and other linters.
  • Clean scope: No linter/workflow/VALIDATE changes or suppressions were added, which is appropriate for a "hold for decision" PR.

@dmzoneill
dmzoneill marked this pull request as ready for review October 24, 2026 11:21
@dmzoneill
dmzoneill merged commit f12f51a into main Oct 24, 2026
31 of 33 checks passed
@dmzoneill
dmzoneill deleted the cursor/fix-super-linter-jscpd branch October 24, 2026 11:22
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