Skip to content

Wrong Method Level Metrics #112

@neelofarhassan

Description

@neelofarhassan

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions