You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SonarQube correctly criticizes the approach as unnecessarily slow.
What should it do:
replace the longest prefix that ends in either / or \ by empty string.
What it really does:
the right thing, as above, but then also:
for each character position of the remaining base filename try to find another / or \
that means if the basename has 100 characters it will try to re-match the regexp on 99 starting points.
My suggestion is to change the generator itself, such that the referenced line gets created that way, instead:
return filename.replaceFirst("^.*[/\\\\]", "");
I hope it makes sense and that others more into the codebase will find the relevant template or generating location instantly...
The text was updated successfully, but these errors were encountered:
I'm aware that the reference below points to generated code, and the culprit is whereever this code gets generated.
openapi-generator/samples/client/petstore/java/okhttp-gson/src/main/java/org/openapitools/client/ApiClient.java
Line 973 in 04169ec
SonarQube correctly criticizes the approach as unnecessarily slow.
What should it do:
What it really does:
that means if the basename has 100 characters it will try to re-match the regexp on 99 starting points.
My suggestion is to change the generator itself, such that the referenced line gets created that way, instead:
I hope it makes sense and that others more into the codebase will find the relevant template or generating location instantly...
The text was updated successfully, but these errors were encountered: