Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • S Source Code Analyzer
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 190
    • Issues 190
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • naomod
  • Model Driven Engineering (MDE)
  • Source Code Analyzer
  • Merge requests
  • !155

Fix bugged rule #770 CommentRequired

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Roxane MARECHAL requested to merge E177318M/projet-2019:fix/770-CommentRequired into master Dec 22, 2019
  • Overview 0
  • Commits 29
  • Changes 3

Problems solved on :

  1. org.eclipse.jdt.source.all.xmi: "Feature name does not exist on TagElement at getAnnotationTypeDeclarationsFromBodyDeclaration#17(analysis.atl[745:5-745:41])"
  2. avoid-enum-as-identifier.xmi : "Unable to access visibility on OclUndefined at matchesCommentRequiredProperty#16(documentation.atl[57:48-57:72])" and "Unable to access name on OclUndefined at avoidStringBufferField#32(bestPractices.atl[84:20-84:38])"

Fixes for :

  • (1) : Removed totally unecessary method getAnnotationTypeDeclarationsFromBodyDeclaration() and simplified the way of getting annotations. This avoids going through other unconcerned elements (source of the error).
  • (2) : The original avoid-enum-as-identifier.xmi seems to have been incorrectly generated, leaving an incomplete generation of the FieldDeclaration object for "enum" in the model. This caused the following problems :
    • the error message (2) for the helpers commentRequired() and avoidStringBufferField()
    • no error message for the helper AvoidEnumAsIdentifier() but doesn't produce any measure for violation of AvoidEnumAsIdentifier in metrics.xmi.
    • Fix: Regenerated avoid-enum-as-identifier.xmi correctly by setting java version to 1.4 (to allow writting enum as identifier) using the same PMD example as the original input file. This gives no more errors, and produces output Measure AvoidEnumAsIdentifier in metrics.xmi.
Edited Dec 22, 2019 by Roxane MARECHAL
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix/770-CommentRequired