Buggy code:
if ( ( ! ( lessonMetaData . getResult ( ) . isEmpty ( ) ) ) && ( ( lessonMetaData . getResult ( ) . size ( ) ) > 0 ) ) { ColumnList < String > lessonMetaDataColumns = lessonMetaData . getResult ( ) ; lessonDataAsMap . put ( TITLE , lessonMetaDataColumns . getColumnByName ( TITLE ) . getStringValue ( ) ) ; } OperationResult < ColumnList < String > > itemData = getCassandraService ( ) . read ( traceId , COLLECTION_ITEM_ASSOC . getColumnFamily ( ) , lessonGooruOid ) ; ColumnList < String > items = itemData . getResult ( ) ; ColumnList < String > lessonMetricColumnList = null ; OperationResult < ColumnList < String > > lessonMetricsData = getCassandraService ( ) . read ( traceId , CLASS_ACTIVITY . getColumnFamily ( ) , classLessonKey ) ; if ( ( lessonMetricsData != null ) && ( ! ( lessonMetricsData . getResult ( ) . isEmpty ( ) ) ) ) { lessonMetricColumnList = lessonMetricsData . getResult ( ) ; } for ( Column < String > item : items ) { Map < String , Object > itemDataAsMap = new HashMap < String , Object > ( ) ; String itemGooruOid = item . getName ( ) ; itemDataAsMap . put ( SEQUENCE , item . getLongValue ( ) ) ; itemDataAsMap . putAll ( getClassMetricsAsMap ( traceId , classLessonKey , itemGooruOid ) ) ; getResourceMeta ( itemDataAsMap , isSecure , traceId , itemGooruOid , getBaseService ( ) . convertStringToCollection ( RESOURCE_TYPE ) ) ; itemDataMapAsList . add ( itemDataAsMap ) ; long itemViews = 0L ; if ( ( lessonMetricColumnList != null ) && ( ( lessonMetricColumnList . size ( ) ) > 0 ) ) { itemViews = lessonMetricColumnList . getLongValue ( getBaseService ( ) . appendTilda ( itemGooruOid , VIEWS ) , 0L ) ; } String itemType = null ; if ( ( ( itemDataAsMap . get ( TYPE ) ) != null ) && ( StringUtils . isNotBlank ( itemDataAsMap . get ( TYPE ) . toString ( ) ) ) ) { itemType = itemDataAsMap . get ( TYPE ) . toString ( ) ; } if ( itemType != null ) { if ( itemType . matches ( ASSESSMENT_TYPES ) ) { assessmentCount ++ ; Long assessmentScore = null ; if ( ( lessonMetricColumnList != null ) && ( ( lessonMetricColumnList . size ( ) ) > 0 ) ) { assessmentScore = lessonMetricColumnList . getLongValue ( getBaseService ( ) . appendTilda ( itemGooruOid , _SCORE_IN_PERCENTAGE ) , null ) ; if ( ( assessmentScore != null ) && ( assessmentScore >= classMinScore ) ) { scoreMet ++ ; assessmentAttempted ++ ; } else if ( ( assessmentScore != null ) && ( assessmentScore < classMinScore ) ) { scoreNotMet ++ ; assessmentAttempted ++ ; } } if ( assessmentScore == null ) { assessmentNotAttempted ++ ; } } else if ( itemType . equalsIgnoreCase ( COLLECTION ) ) { if ( itemViews > 0 ) { collectionViewed ++ ; } else { collectionNotViewed ++ ; } } } } lessonDataAsMap . putAll ( getActivityMetricsAsMap ( traceId , classLessonKey , lessonGooruOid ) ) ; lessonDataAsMap . put ( TYPE , LESSON ) ; lessonDataAsMap . put ( ITEM , itemDataMapAsList ) ; String lessonScoreStatus = null ; if ( ( assessmentAttempted == 0 ) && ( ( itemDataMapAsList . size ( ) ) == assessmentNotAttempted ) ) { lessonScoreStatus = ApiConstants . NOT_ATTEMPTED ; } else <START_BUG> if ( ( scoreNotMet > 0 ) || ( ( assessmentNotAttempted > 0 ) && ( ( assessmentCount != 0L ) && ( scoreMet < assessmentCount ) ) ) ) { <END_BUG> lessonScoreStatus = ApiConstants . SCORE_NOT_MET ; } else if ( ( ( ( scoreMet > 0 ) && ( scoreNotMet == 0 ) ) && ( assessmentNotAttempted == 0 ) ) && ( ( assessmentCount != 0L ) && ( scoreMet == assessmentCount ) ) ) { lessonScoreStatus = ApiConstants . SCORE_MET ; } else if ( assessmentNotAttempted > 0 ) { lessonScoreStatus = ApiConstants . NOT_ATTEMPTED ; } else if ( ( collectionViewed == ( items . size ( ) ) ) && ( collectionNotViewed == 0 ) ) { lessonScoreStatus = ApiConstants . VIEWED ; } else if ( ( ( collectionNotViewed == ( items . size ( ) ) ) && ( collectionViewed == 0 ) ) || ( collectionNotViewed > 0 ) ) { lessonScoreStatus = ApiConstants . NOT_VIEWED ; } lessonDataAsMap . put ( SCORE_STATUS , lessonScoreStatus ) ; if ( ( ! ( lessonDataAsMap . isEmpty ( ) ) ) && ( ( lessonDataAsMap . size ( ) ) > 0 ) ) { resultDataMapAsList . add ( lessonDataAsMap ) ; } } responseParamDTO . setContent ( resultDataMapAsList ) ; return responseParamDTO ; } public ResponseParamDTO < Map < String , Object > > getLessonAssessmentsUsage ( String traceId , String classId , String courseId , String unitId , String lessonId , String assessmentIds , String userUid , boolean isSecure ) throws Exception { } public ResponseParamDTO < Map < String , Object > > getStudentAssessmentData ( String traceId , String classId , String courseId , String unitId , String lessonId , String assessmentId , String sessionId , String userUid , String collectionType , boolean isSecure ) throws Exception { } private Map < String , Long > getContentMeta ( String traceId , String key , String fetchColumnList ) { } private String getSessionIdFromKey ( String traceId , String recentSessionKey ) { } private List < Map < String , Object > > getResourceData ( String traceId , boolean isSecure , String keys , Collection < String > columnsToFetch , String type ) { } private void getResourceMeta ( Map < String , Object > dataMap , boolean isSecure , String traceId , String key , Collection < String > columnsToFetch ) { }

Fix:
if ( ( scoreNotMet > 0 ) || ( ( assessmentAttempted > 0 ) && ( ( assessmentCount != 0L ) && ( scoreMet < assessmentCount ) ) ) ) {