329 Commits

Author SHA1 Message Date
Andreas Dangel
d284ea9634 [maven-release-plugin] prepare for next development iteration 2020-12-12 09:42:10 +01:00
Andreas Dangel
d2e4fb4ca3 [maven-release-plugin] prepare release pmd_releases/6.30.0 2020-12-12 09:42:02 +01:00
Jeff Bartolotta
4e00c20499 Small comment and doc edits 2020-12-10 22:20:10 -08:00
Clément Fournier
f7829531c9 Add some doc 2020-12-10 20:17:51 +01:00
Jeff Bartolotta
f805b85850 Fix Html DataType
This DataType does not need to be escaped, it is always escaped by the
server.
2020-12-09 20:11:25 -08:00
Clément Fournier
2d5781482e Fix tests 2020-11-24 12:22:32 +01:00
Clément Fournier
b94ac4f018 Don't create a vf language module per parser options 2020-11-24 12:09:25 +01:00
Clément Fournier
0ad1f47b29 Use interface instead of deprecated abstract class 2020-11-24 12:02:32 +01:00
Clément Fournier
fabf2cf6db Make the parser options properties private 2020-11-24 11:53:45 +01:00
Clément Fournier
21506cea85 Cleanup languages to skip 2020-11-24 11:39:59 +01:00
Jeff Bartolotta
86b5948f07 Update the way nodes with data are identified
Changed method for how the Visualforce strings are reconstructed from the AST. The previous implementation had incorrect assumptions about the structure of the AST. Added tests to more thoroughly test these situations.

Changed name of IdentifierType to DataType. This information can be stored on either ASTIdentifier or ASTLiteral nodes.

Changes based on PR feedgack:
- Restored ParserOptionsTest in order to avoid binary compatibilty issues.
- Changed ParserOptions to contain a PropertySource instead of extending AbtractPropertySource.
2020-11-20 11:59:23 -08:00
Jeff Bartolotta
e1c42a10ec Move visitor to VfParser#parse
LanguageVersionHandler#getTypeResolutionFacade is deprecated. Moved the VfExpressionTypeVisitor creation and execution to VfParser#parse instead.

ParsingOptionsTest located in pmd-test wasn't running previously because it was in the src/main hierarchy. Moved this test into the src/test hierarchy and consolidated the methods from the
similarly named class from pmd-core.
2020-11-12 20:13:19 -08:00
jbartolotta-sfdc
0348b2c0d2 Merge branch 'master' into issue1092-vf-escape-false-positives 2020-11-12 10:39:10 -08:00
Jeff Bartolotta
db7bf0a786 Store type information in AST instead of map
Store the IdentifierType on ASTIdentifier node instead of in a separate map.

Use the existing TypeResolution pattern to configure the visitor instead deriving from an abstract rule.

Changed ParserOptions to extend AbstractPropertySource with the ability to override the defaults via environment variables.
2020-11-12 10:15:04 -08:00
Jeff Bartolotta
ba2e91b3a0 Exclude languages in AbstractRuleSetFactoryTest
Allow subclasses of AbstractRuleSetFactoryTest to filter out languages
that show up in the classpath but should not be tested.

Change VFTestContstants to final instead of abstract.
2020-10-29 17:22:35 -07:00
Jeff Bartolotta
6f7bebcecd Configure visualforce to require Java 8
pmd-visualforce depends on pmd-apex. pmd-apex relies on Java 8. This change configures pmd-visualforce to also require Java 8.

This is a breaking change that will need to be documented.
2020-10-28 15:10:26 -07:00
Jeff Bartolotta
f70b2e44fc Rename ExpressionType, remove google collections
Renamed ExpressionType to IdentifierType since this is more accurate.

Removed usage of google.collect classes that were causing UnsupportedClassVersionError exception in the Travis CI run.
2020-10-27 16:23:14 -07:00
Andreas Dangel
4837c8dbc8 [maven-release-plugin] prepare for next development iteration 2020-10-24 10:17:24 +02:00
Andreas Dangel
81f12d3e5d [maven-release-plugin] prepare release pmd_releases/6.29.0 2020-10-24 10:17:15 +02:00
Jeff Bartolotta
ef9e350fd5 Mark AbstractVfTypedElExpressionRule as abstract 2020-10-22 12:11:44 -07:00
Jeff Bartolotta
ddf55c7f81 Provide type information to Visualforce rules
Addresses the general issue raised in https://github.com/pmd/pmd/issues/1092 This commit removes false positives from expressions in apex tags. The specific use case raised in 1092 isn't reproducible and represents a false negative that will be fixed separately.

The existing Visualforce rules don't have any information about the data types referenced in the Visualforce page. This results in false positives when attempting to identify expressions that are vulnerable to XSS attacks. The rules should not warn about XSS attacks when the expression refers to a type such as Integer or Boolean.

The VfExpressionTypeVisitor visits the Visualforce page and extracts the datatypes from Salesforce metadata. Data type information can come from either Apex classes or Object Fields. The Salesforce metadata is generally located in a sibling directory of the Visualforce directory. By default the code looks in directories relative to the Visualforce file to find the metadata. The conventional locations for the metadata are "../classes" and "../objects", the user can override this default with other directories if required.
2020-10-22 11:30:45 -07:00
Andreas Dangel
7f70cac7ca Merge branch 'pr-2834' into master
[vf] Allow attributes with dot in Visualforce #2834
2020-10-22 09:48:36 +02:00
rmohan
7e7182b26d Modifying VF tokenizer test content to keep up with the minor grammar change
Streamlined IDENTIFIED_DOTTED logic. Added a couple more negative tests
2020-10-16 09:31:43 -07:00
Andreas Dangel
aa245c6e1b [maven-release-plugin] prepare for next development iteration 2020-09-26 10:25:16 +02:00
Andreas Dangel
722f3ca997 [maven-release-plugin] prepare release pmd_releases/6.28.0 2020-09-26 10:25:05 +02:00
rmohan
5ea116fa52 First draft of change to allow dotted attributes in Visualforce 2020-09-18 13:45:43 -07:00
Andreas Dangel
c59af0aee6 [maven-release-plugin] prepare for next development iteration 2020-08-31 18:30:18 +02:00
Andreas Dangel
856950f0d2 [maven-release-plugin] prepare release pmd_releases/6.27.0 2020-08-31 18:30:09 +02:00
XenoAmess
244a39db0f fix typos. 2020-08-27 11:47:11 +08:00
Andreas Dangel
06d2225b27 [vf] Deprecate VfSimpleCharStream 2020-08-20 10:38:41 +02:00
Andreas Dangel
23bc58f23c [vf] Use tabSize=1 as well 2020-08-20 10:38:19 +02:00
Andreas Dangel
eb683569af Merge branch 'pr-2617'
[core] Deprecate missing language attribute on rule definition #2617
2020-07-30 10:19:03 +02:00
Andreas Dangel
49ab75aeb7 [maven-release-plugin] prepare for next development iteration 2020-07-25 13:45:36 +02:00
Andreas Dangel
a9632e2a06 [maven-release-plugin] prepare release pmd_releases/6.26.0 2020-07-25 13:45:27 +02:00
Andreas Dangel
044d7aea2d Merge branch 'pr-2638'
[visualforce] add new safe resource for VfUnescapeEl #2638
2020-07-17 15:29:25 +02:00
Andreas Dangel
7b3d31246e Merge branch 'master' into pr-2624 2020-07-17 15:16:24 +02:00
Andreas Dangel
7ae424a35b Add deprecation javadocs 2020-07-17 14:43:43 +02:00
Andreas Dangel
94afdb117d Add test engines as surefire plugin dependencies
This removes junit-vintage-engine as a test dependency
as well as kotlintest-runner-junit5.
The engines are only needed during test execution, but should
not be available for test compilation.

For this to work, the latest surefire plugin is required.
2020-07-17 12:03:45 +02:00
Andreas Dangel
d89a6d080d [visualforce] Add test for VfUnescapeEl with $MessageChannel 2020-07-09 12:20:09 +02:00
Peter Chittum
2fb196b16a [visualforce] added new global variable name to safe resources
Cherry-picked from 7f0f91f71aac132e3c5ddd9ce397c73f19ebb04e
2020-07-09 12:19:54 +02:00
Peter Chittum
5e50b16e05 [visualforce] added new global variable name to safe resources
Cherry-picked from 25cb8de645e0c016a99a933950bffdc996d74b39
2020-07-09 12:19:38 +02:00
Clément Fournier
8add323403 Fix other offenders 2020-07-06 14:02:21 +02:00
Andreas Dangel
370c0b0b6d Remove unused dependency, explicitly declare used dependencies 2020-07-02 15:12:31 +02:00
Andreas Dangel
c7ccb8a087 javacc is only needed during parser generation 2020-07-02 10:27:26 +02:00
Clément Fournier
49635c2a66 Deprecate Rulechain visitors 2020-07-01 11:27:38 +02:00
Clément Fournier
659066ee02 Deprecate BaseLanguageModule constructor 2020-07-01 11:27:38 +02:00
Clément Fournier
d7f96e08d9 Uniformize apply across languages 2020-07-01 11:27:38 +02:00
Robert Sösemann
715626bfc4 Revert "[visualforce] add new safe resource for VfUnescapeEl" 2020-06-30 14:37:14 +02:00
Peter Chittum
7f0f91f71a added new global variable name to safe resources 2020-06-30 08:18:45 +01:00
Peter Chittum
25cb8de645 added new global variable name to safe resources 2020-06-30 08:15:25 +01:00