Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable ForbiddenMethodCall #4334

Merged
merged 3 commits into from Dec 2, 2021
Merged

Enable ForbiddenMethodCall #4334

merged 3 commits into from Dec 2, 2021

Conversation

BraisGabin
Copy link
Member

@BraisGabin BraisGabin commented Nov 25, 2021

This PR enables ForbiddenMethodCall by default and then it adds Url.openStream and Class.getResourceAsStream to the list.

We need to add support to a description for each forbidden method. If someone in one year find this will now know about the existence of the "safe" version.


I'm creating a new module detekt-utils. The problem is that detekt-tooling are toolings related with the compiler and I couldn't add it anywhere becuase I was introducting circular dependenciees. This detekt-utils is a more basic module. Right now it only contains one file to avoid those extrange behaviours when using Url.openStream() and Class.openResourceAsStream().

I'm not a big fan to create another module but I don't know how to fix this otherwise.

@BraisGabin BraisGabin added the housekeeping Marker for housekeeping tasks and refactorings label Nov 25, 2021
@codecov
Copy link

codecov bot commented Nov 25, 2021

Codecov Report

Merging #4334 (67993bb) into main (a1150bc) will decrease coverage by 0.00%.
The diff coverage is 18.18%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #4334      +/-   ##
============================================
- Coverage     84.23%   84.23%   -0.01%     
  Complexity     3258     3258              
============================================
  Files           474      473       -1     
  Lines         10322    10319       -3     
  Branches       1824     1823       -1     
============================================
- Hits           8695     8692       -3     
- Misses          666      667       +1     
+ Partials        961      960       -1     
Impacted Files Coverage Δ
...ab/arturbosch/detekt/core/config/Configurations.kt 84.37% <ø> (ø)
...lab/arturbosch/detekt/core/config/DefaultConfig.kt 66.66% <ø> (ø)
...bosch/detekt/core/tooling/DefaultConfigProvider.kt 80.00% <ø> (ø)
...itlab/arturbosch/detekt/generator/DetektPrinter.kt 0.00% <0.00%> (ø)
.../arturbosch/detekt/generator/out/AbstractWriter.kt 0.00% <0.00%> (ø)
.../gitlab/arturbosch/detekt/api/internal/Versions.kt 87.50% <100.00%> (ø)
...n/io/github/detekt/report/html/HtmlOutputReport.kt 95.55% <100.00%> (ø)
...rc/main/kotlin/io/github/detekt/utils/Resources.kt

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1150bc...67993bb. Read the comment docs.

detekt-api/build.gradle.kts Show resolved Hide resolved
@BraisGabin BraisGabin merged commit 92433ea into main Dec 2, 2021
@BraisGabin BraisGabin deleted the enable-forbidden-call branch December 2, 2021 09:43
@BraisGabin BraisGabin added this to the 1.20.0 milestone Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Marker for housekeeping tasks and refactorings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants