Why is pmd seemingly not scanning the right directory

77 Views Asked by At

After going through the logs when pmd is ran through maven i can see that the correct langauge (javascript) and rules seem to be getting applied but it says no errors or equivalent found when i purposefully put in some errors that omd should detect. If the rules and such are being applied then i can only come to the conclusion that the wrong directory is being scanned somehow but i dont see what is wrong with the xml file.

relevant xml looks like this

<reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-pmd-plugin</artifactId>
            <version>3.20.0</version>
            <configuration>
                <language>javascript</language>
                <rulesets>
                    <ruleset>/category/ecmascript/bestpractices.xml</ruleset>
                    <ruleset>/category/ecmascript/codestyle.xml</ruleset>
                    <ruleset>/category/ecmascript/errorprone.xml</ruleset>
                </rulesets>
                <includes>
                    <include>**/*.js</include>
                </includes>
                <excludes>
                    <exclude>.*/node_modules/*.*</exclude>
                </excludes>
                <compileSourceRoots>
                    <compileSourceRoot>${basedir}\..\..\TODO_list_javascript</compileSourceRoot>
                </compileSourceRoots>
            </configuration>
            <reportSets>
                <reportSet>
                    <reports>
                        <report>pmd</report>
                    </reports>
                </reportSet>
            </reportSets>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jxr-plugin</artifactId>
            <version>3.3.0</version>
        </plugin>
    </plugins>
</reporting>

I did not change much from what came with pmd-javascript except the reporting part which was copy and paste from the guide on the apache maven website. Compile sources root is what pmg should scan according to the tooltip but maybe the path is wrong somehow?

Here is a small snippet of the logs

[DEBUG] Processing *path*/Applications/pmd-pmd_releases-7.0.0-rc1/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/AbstractInfixEcmascriptNode.java
[DEBUG] Processing *path*/Applications/pmd-pmd_releases-7.0.0-rc1/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/rule/bestpractices/ConsistentReturnRule.java
[DEBUG] Processing *path*/Applications/pmd-pmd_releases-7.0.0-rc1/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/rule/AbstractEcmascriptRule.java
[DEBUG] Processing *path*/Applications/pmd-pmd_releases-7.0.0-rc1/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/TrailingCommaNode.java
[DEBUG] No type information for node Expression
[DEBUG] Processing *path*/Applications/pmd-pmd_releases-7.0.0-rc1/pmd-javascript/src/main/java/net/sourceforge/pmd/lang/ecmascript/ast/EcmascriptVisitorBase.java
[DEBUG] Processing *path*/Applications/pmd-pmd_releases-7.0.0-rc1/pmd-javascript/src/main /java/net    /sourceforge/pmd/lang/ecmascript/ast/EcmascriptVisitor.java
[DEBUG] No type information for node Expression
[DEBUG] PMD finished. Found 0 violations.
[DEBUG] Removing excluded violations. Using 0 configured exclusions.
[DEBUG] Excluded 0 violations.

Pmd to find violations and report them

0

There are 0 best solutions below