{
  "jira_key": "AN-62",
  "passed": false,
  "cycle": 2,
  "findings": [
    {
      "severity": "high",
      "category": "Validation Rule Logic",
      "file": "force-app/main/default/objects/Opportunity/validationRules/Prevent_Type_Edit.validationRule-meta.xml",
      "line": 1,
      "message": "The Prevent_Type_Edit validation rule does not enforce the requirement that an Override Reason must be provided when overriding Type. The formula only checks for the Opportunity_Type_Override permission, but does not require Override_Reason__c to be populated. This allows users with the permission to override Type without providing a reason, which does not meet the acceptance criteria.",
      "fixable": true
    },
    {
      "severity": "medium",
      "category": "Apex Bulkification",
      "file": "force-app/main/default/classes/OpportunityDataMigration.cls",
      "line": 1,
      "message": "The OpportunityDataMigration.run() method performs a SOQL query inside a loop to count closed-won Opportunities per Account. This can lead to governor limit issues in orgs with many Opportunities. Refactor to bulkify by pre-querying AccountId to won count mapping for all relevant Accounts.",
      "fixable": true
    },
    {
      "severity": "medium",
      "category": "Validation Rule Logic",
      "file": "force-app/main/default/objects/Opportunity/validationRules/Strategic_Proposal_Stage_Validation.validationRule-meta.xml",
      "line": 1,
      "message": "The Strategic_Proposal_Stage_Validation rule attempts to block Strategic Opportunities from moving past Proposal stage unless Executive Sponsor is populated. However, the logic may not correctly identify all stages after Proposal, as it only excludes certain stages by name. Consider using a more robust approach, such as a custom metadata type or a formula that checks the stage order, to future-proof against stage changes.",
      "fixable": false
    },
    {
      "severity": "low",
      "category": "Documentation",
      "file": "force-app/main/default/flows/Opportunity_Type_Assignment.flow-meta.xml",
      "line": 1,
      "message": "The flow metadata is truncated and not fully reviewable. Ensure the full flow definition is present in version control and deployment artifacts.",
      "fixable": false
    },
    {
      "severity": "low",
      "category": "Apex Best Practice",
      "file": "force-app/main/default/classes/OpportunityDataMigration.cls",
      "line": 1,
      "message": "The OpportunityDataMigration class is missing test coverage. Add a corresponding test class to ensure deployment and maintainability.",
      "fixable": true
    }
  ],
  "summary": "One high-severity issue: the Prevent_Type_Edit validation rule does not require Override Reason when overriding Type, which is a requirement. Two medium and two low issues are also present. See findings for details.",
  "static_analysis_status": "passed",
  "notes": "Address the high-severity validation rule logic issue before proceeding. Medium/low issues should be addressed for robustness and maintainability."
}