Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/code-analyzer-pmd-engine/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@salesforce/code-analyzer-pmd-engine",
"description": "Plugin package that adds 'pmd' and 'cpd' as engines into Salesforce Code Analyzer",
"version": "0.14.0",
"version": "0.14.1-SNAPSHOT",
"author": "The Salesforce Code Analyzer Team",
"license": "BSD-3-Clause",
"homepage": "https://developer.salesforce.com/docs/platform/salesforce-code-analyzer/overview",
Expand Down
2 changes: 1 addition & 1 deletion packages/code-analyzer-pmd-engine/src/pmd-engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function toRuleDescription(pmdRuleInfo: PmdRuleInfo): RuleDescription {
severityLevel: toSeverityLevel(pmdRuleInfo.priority),
tags: ['Recommended', pmdRuleInfo.ruleSet.replaceAll(' ', ''), languageId + 'Language'],
description: pmdRuleInfo.description,
resourceUrls: [pmdRuleInfo.externalInfoUrl] // TODO: Eventually we'll want to add in well architected links
resourceUrls: pmdRuleInfo.externalInfoUrl ? [pmdRuleInfo.externalInfoUrl] : [] // TODO: Eventually we'll want to add in well architected links
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/code-analyzer-pmd-engine/test/pmd-engine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ describe('Tests for the describeRules method of PmdEngine', () => {
const fakeRule10Description: RuleDescription = expectContainsRuleWithName(ruleDescriptions, 'fakerule10'); // From somecat4.xml
expect(fakeRule10Description.severityLevel).toEqual(SeverityLevel.High);
expect(fakeRule10Description.tags).toEqual(['Recommended', 'SomeCat4', 'javascriptLanguage']);
expect(fakeRule10Description.resourceUrls).toHaveLength(0); // This particular rule purposely has no externalInfoUrl defined, so we confirm that it gives no resourceUrls.
expectContainsRuleWithName(ruleDescriptions, 'fakerule11'); // From somecat4.xml
expectContainsRuleWithName(ruleDescriptions, 'fakerule12'); // From somecat4.xml
expectContainsRuleWithName(ruleDescriptions, 'fakerule13'); // From somecat4.xml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
message="Avoid using with - it's bad news"
language="ecmascript"
since="5.0.1"
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"
externalInfoUrl="${pmd.website.baseurl}/pmd_rules_ecmascript_bestpractices.html#avoidwithstatement">
class="net.sourceforge.pmd.lang.rule.xpath.XPathRule"> <!-- Removed the externalInfoUrl attribute so that we can test what happens when this is missing -->
<description>Avoid using with - it's bad news</description>
<priority>1</priority>
<properties>
Expand Down