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

Wrong Method Level Metrics #112

Open
neelofarhassan opened this issue Feb 19, 2024 · 0 comments
Open

Wrong Method Level Metrics #112

neelofarhassan opened this issue Feb 19, 2024 · 0 comments

Comments

@neelofarhassan
Copy link

I have a test class having 2 methods. I am interested in finding the method-level metrics for this class.

public class test{

getUsersWaitingNotificationNoWatchExpectEmptyList ( ) {
    net . jforum . repository . TopicWatchRepository dao = this . newDao ( ) ; 
    net . jforum . entities . Topic topic = new net . jforum . entities . Topic ( ) ; 
    topic . setId ( 13 ) ; java . util . List < net . jforum . entities . User > users = dao . getUsersWaitingNotification ( topic ) ; 
    assertEquals(0, users.size()) ; 
}

getUsersWaitingNotification ( net . jforum . entities . Topic ) {    
    java . util . List < net . jforum . entities . User > users = session . createQuery ( ( "select<sp>u<sp>from<sp>TopicWatch<sp>tw<sp>" + ( "<sp>inner<sp>join<sp>tw.user<sp>u<sp>where<sp>tw.topic<sp>=<sp>:topic<sp>" + "<sp>and<sp>(tw.read<sp>=<sp>true<sp>or<sp>u.notifyAlways<sp>=<sp>true)" ) ) ) . setEntity ( "topic" , topic ) . setComment ( "topicWatchDAO.getUsersWaitingNotification" ) . list ( ) ; 
    if ( ( users . size ( ) ) > 0 ) { 
        this . markAllAsUnread ( topic ) ;  } 
    return users ;
}

}

The value of " returnsQty" for both methods is 0, while "LOC" for method 1 is 2 and for method 2 is 7. Furthermore, I was expecting the "maxNestingBlocksQty" to be greater than 0 for method 2, as it has an if statement. However, this metric is 0 for both methods.

Any suggestions, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant