Comments (15)
Currently I only read the files defined in the rules.properties
to get the name etc.
Can we have the remediation points in the ruleset xml files? Also what would be the best way to map remediation points to time?
from codacy-pmd.
There are not so many people using CodeClimate yet so instead using the remediation points I suggest adding Codacy specific params.
So in my repositories I would extend this https://github.com/Up2Go/travelexpenses/blob/master/apex-ruleset.xml by adding a few lines per rule:
<rule ref="rulesets/apex/complexity.xml/IfWithoutbraces" message="...">
<priority>3</priority>
<properties>
<property name="minimum" value="1000"/>
<!-- relevant for Code Climate output only -->
<property name="cc_categories" value="Complexity"/>
<property name="cc_remediation_points_multiplier" value="100"/>
<property name="cc_block_highlighting" value="false"/>
<!-- relevant for Codacy output only -->
<property name="codacy_minutes_to_fix" value="1"/>
</properties>
@rtfpessoa What do you think about this?
from codacy-pmd.
This sounds good to me.
from codacy-pmd.
@rtfpessoa should I update the apex-ruleset.xml to have times to fix properties?
from codacy-pmd.
That would be amazing.
I would definitely be more confortable with your times.
from codacy-pmd.
@rtfpessoa I created this PR for PMD pmd/pmd#329 adding on of the following distinct values per issue:
- a work week of 5 days and 6 effective hours : 1800 min
- a work day of 6 effective hours : 360 min
- an hour : 60 min
- minimum effort: 10 min
Could you also recode you engine that it always takes the default ruleset.xml if there is no repo-specific?
For the Apex module it is here:
https://github.com/pmd/pmd/blob/master/pmd-apex/src/main/resources/rulesets/apex/ruleset.xml
from codacy-pmd.
Ok, nice.
from codacy-pmd.
Merged to PMD but not made it into PMD 5.6.0. Will be released in May.
from codacy-pmd.
I will leave this open until I see how the numbers show up. Are you already parsing the new property?
from codacy-pmd.
Not yet. Need to do some changes.
from codacy-pmd.
@rtfpessoa The PMD maintainer rejected an Apex/Visualforce only solution of the problem in PMD and instead suggest an alternative solution where the required artefacts are generated by you plugin. Sounds good to me as we keep coupling between Codacy and PMD low.
Could you please check @adangel's comments here pmd/pmd#329 (comment) and tell me if you are willing to support that solution. Time to fix is an important feature.
from codacy-pmd.
Just made a quick update that uses the timeToFix you specified. For new rules we just need to add more lines in the same place #38
from codacy-pmd.
This is in prod and even for old issues they should already reflect the new values.
from codacy-pmd.
But aren't the PMD maintainers rejecting our solution?! I am confused.
@rtfpessoa Can you please elaborate a bit on how you solved this and how developer can override the ttf values per repo.
from codacy-pmd.
I did your suggestion in #38 and for now when you have more times just add to the list in a PR here and it will appear in Codacy in the next versions.
from codacy-pmd.
Related Issues (17)
- [CY-6456] ERROR c.c.a.c.a.CodacyPluginsAnalyser:52 - Failed metrics for metrics HOT 2
- [CY-6630] Request to bump PMD to 6.51.0 HOT 2
- False positive in UnusedPrivateMethod HOT 4
- Support for new PMD rules required? HOT 2
- Need PMD Apex language support. Would contribute to it... HOT 39
- Support Visualforce language with 5.6.0 PMD release HOT 8
- Make Salesforce *.resource files work in CSS + JS engines HOT 6
- [feature] As a ruleset admin I want to see if and why my ruleset made PMD fail HOT 4
- PMD 6.0.0 update HOT 16
- Cannot find clear definition of the default Codacy PMD ruleset HOT 3
- Package private test methods with JUnit 5 HOT 4
- Leverage Github Checks API HOT 1
- Support for incremental analysis? HOT 2
- PMD DocGenerator generates strange pattern titles HOT 2
- Cannot configure tool with .codacy.yml HOT 1
- Update PMD to 6.25.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codacy-pmd.