There are two reasons for the error in the total instruction number:#80
Open
skyevil12 wants to merge 1 commit intoform-com:masterfrom
Open
There are two reasons for the error in the total instruction number:#80skyevil12 wants to merge 1 commit intoform-com:masterfrom
skyevil12 wants to merge 1 commit intoform-com:masterfrom
Conversation
- The current method of ignoring instructions based on the number of code changes has issues. The current logic only ignores bytecode in LINENUMBER node blocks, leading to some unforeseen situations in Kotlin. I have submitted a pull request that ignores all Linenumber bytecode within a method that is not part of the code changes. This adjustment yields the desired result in the graph.
- The algorithm for determining the result line numbers of code changes also contributes to miscalculating the total line number. I am currently investigating JGit to explore if we can employ an algorithm similar to 'git diff' to select the most suitable method for calculating the code change results. If JGit solution is not found, the alternative would be to instruct the user to run the diff command separately and input the diff result to generate the report.
For example:
'git diff' default output is,
--- a/app/src/main/java/org/angmarch/jacococompose/ComposeComponent.kt
+++ b/app/src/main/java/org/angmarch/jacococompose/ComposeComponent.kt
@@ -16,4 +16,8 @@ fun ComposeComponent(text: String) {
Surface {
Text(text = text)
}
+} <- this would cause wrong instruction being retained in pull request coverage report.
+
+fun catchMeIfYouCan() {
+ println("I'm a testable function")
}
A more favorable outcome could be achieved by issuing the command 'git diff -b' to ignore space changes.
--- a/app/src/main/java/org/angmarch/jacococompose/ComposeComponent.kt
+++ b/app/src/main/java/org/angmarch/jacococompose/ComposeComponent.kt
@@ -17,3 +17,7 @@ fun ComposeComponent(text: String) {
Text(text = text)
}
}
+
+fun catchMeIfYouCan() {
+ println("I'm a testable function")
+}
Contributor
|
Hi @skyevil12 I'm the author of this plugin. I have an independent fork of the plugin that is actively maintained. |
Author
|
Sure, just create PR in another repo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before

After

For example:
'git diff' default output is,
A more favorable outcome could be achieved by issuing the command 'git diff -b' to ignore space changes.