Code Monkey home page Code Monkey logo

Comments (15)

rtfpessoa avatar rtfpessoa commented on June 14, 2024

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.

rsoesemann avatar rsoesemann commented on June 14, 2024

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.

rtfpessoa avatar rtfpessoa commented on June 14, 2024

This sounds good to me.

from codacy-pmd.

rsoesemann avatar rsoesemann commented on June 14, 2024

@rtfpessoa should I update the apex-ruleset.xml to have times to fix properties?

from codacy-pmd.

rtfpessoa avatar rtfpessoa commented on June 14, 2024

That would be amazing.
I would definitely be more confortable with your times.

from codacy-pmd.

rsoesemann avatar rsoesemann commented on June 14, 2024

@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.

rtfpessoa avatar rtfpessoa commented on June 14, 2024

Ok, nice.

from codacy-pmd.

rsoesemann avatar rsoesemann commented on June 14, 2024

Merged to PMD but not made it into PMD 5.6.0. Will be released in May.

from codacy-pmd.

rsoesemann avatar rsoesemann commented on June 14, 2024

I will leave this open until I see how the numbers show up. Are you already parsing the new property?

from codacy-pmd.

rtfpessoa avatar rtfpessoa commented on June 14, 2024

Not yet. Need to do some changes.

from codacy-pmd.

rsoesemann avatar rsoesemann commented on June 14, 2024

@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.

rtfpessoa avatar rtfpessoa commented on June 14, 2024

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.

rtfpessoa avatar rtfpessoa commented on June 14, 2024

This is in prod and even for old issues they should already reflect the new values.

from codacy-pmd.

rsoesemann avatar rsoesemann commented on June 14, 2024

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.

rtfpessoa avatar rtfpessoa commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.