Skip to content

fix(#1542): Fix link to type alias of method parameter undefined in signature.#1685

Merged
tcorral merged 9 commits intodevelopfrom
fix/1542-type-alias-of-method-parameter
Jan 12, 2026
Merged

fix(#1542): Fix link to type alias of method parameter undefined in signature.#1685
tcorral merged 9 commits intodevelopfrom
fix/1542-type-alias-of-method-parameter

Conversation

@tcorral
Copy link
Collaborator

@tcorral tcorral commented Dec 20, 2025

Pull Request: Fix Type Alias Links in Method Signatures

Fixes: #1542

Problem

Type aliases in method signatures generated incorrect links to ../undefineds/TypeName.html instead of ../miscellaneous/typealiases.html#TypeName.

Solution

Updated function-signature.helper.ts to properly handle miscellaneous types (type aliases, enums, functions, variables) by checking both type and ctype properties and mapping subtypes to correct documentation pages.

Changes

  • Modified: src/app/engines/html-engine-helpers/function-signature.helper.ts

    • Updated helperFunc() and handleFunction() methods
    • Added miscellaneous type detection and link generation
  • Added: Regression tests (9 tests, all passing)

    • test/src/cli/cli-type-alias-in-signatures.spec.ts
    • test/fixtures/todomvc-ng2/src/app/shared/models/type-alias-in-signature.model.ts

Test Results

✅ 646 tests passing (includes 9 new regression tests)
✅ No breaking changes
✅ All test cases verify correct link generation and absence of undefined links

@tcorral tcorral requested a review from vogloblinsky December 20, 2025 18:52
@tcorral tcorral force-pushed the fix/1542-type-alias-of-method-parameter branch from c8416d1 to b2f0e78 Compare December 20, 2025 19:10
- Extract decorator type checking into generic hasDecoratorType() method
  - 5 separate methods now delegate to single implementation (44% reduction)

- Extract JSDoc tags processing into processJSDocTags() helper
  - Used by 9 methods, eliminates 70 lines of duplication (97% reduction)

- Extract JSDoc comment extraction into extractAndProcessJSDocComment()
  - Used by 8 methods, eliminates 39 lines of duplication (97% reduction)

- Extract documentation field initialization into initializeDocumentationFields()
  - Used by 9 methods, eliminates 15 lines of duplication (94% reduction)

Overall reduction:
- Total lines saved: 144 lines (83% of duplicated code)
- File size reduced: 1715 → 1595 lines (120 lines, 7% overall)
- Duplication rate: 16% → 8-10% (50% reduction)
- Methods refactored: 10+
- New helper methods: 4

Benefits:
- Improved maintainability: changes only need to be made in one place
- Better consistency: all methods follow same patterns
- Reduced bug risk: centralized logic prevents inconsistencies
- Enhanced readability: less boilerplate code
- Easier testing: helper methods independently testable

All functionality preserved, build successful, zero breaking changes.
@tcorral
Copy link
Collaborator Author

tcorral commented Jan 6, 2026

@vogloblinsky I need some help solving the problem with the build in Sonarcloud.

@vogloblinsky
Copy link
Contributor

@tcorral i changed the default quality gate of compodoc in sonar to a custom one with "Coverage | is less than | 20.0%"

@vogloblinsky
Copy link
Contributor

@tcorral Code coverage config updated on main branch

Copy link
Contributor

@vogloblinsky vogloblinsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, thanks for the work

@sonarqubecloud
Copy link

@tcorral tcorral merged commit d998467 into develop Jan 12, 2026
9 checks passed
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.

Link to type alias of method parameter undefined in signature

2 participants