Fix coverage with several contract classes; table annotation and file path checks; clean task dir on write
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014aUaQeLnwbb1zTpN7kHeat
This commit is contained in:
102
tasks_gen/eval/G0106/faulty/m0_app_scorer.clas.abap
Normal file
102
tasks_gen/eval/G0106/faulty/m0_app_scorer.clas.abap
Normal file
@@ -0,0 +1,102 @@
|
||||
CLASS {{p}}app_scorer DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES ty_status TYPE c LENGTH 4.
|
||||
|
||||
TYPES: BEGIN OF ty_result,
|
||||
status TYPE ty_status,
|
||||
score TYPE i,
|
||||
rating TYPE string,
|
||||
END OF ty_result.
|
||||
|
||||
CONSTANTS: BEGIN OF co_status,
|
||||
ok TYPE ty_status VALUE 'OK',
|
||||
bad_years TYPE ty_status VALUE 'YEAR',
|
||||
bad_match TYPE ty_status VALUE 'MATC',
|
||||
bad_degree TYPE ty_status VALUE 'DEGR',
|
||||
END OF co_status.
|
||||
|
||||
METHODS evaluate
|
||||
IMPORTING
|
||||
iv_years TYPE i
|
||||
iv_degree TYPE string
|
||||
iv_match TYPE i
|
||||
RETURNING
|
||||
VALUE(rs_result) TYPE ty_result.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS experience_points
|
||||
IMPORTING iv_years TYPE i
|
||||
RETURNING VALUE(rv_points) TYPE i.
|
||||
METHODS education_points
|
||||
IMPORTING iv_degree TYPE string
|
||||
RETURNING VALUE(rv_points) TYPE i.
|
||||
METHODS skill_points
|
||||
IMPORTING iv_match TYPE i
|
||||
RETURNING VALUE(rv_points) TYPE i.
|
||||
METHODS rating_for
|
||||
IMPORTING iv_score TYPE i
|
||||
RETURNING VALUE(rv_rating) TYPE string.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}app_scorer IMPLEMENTATION.
|
||||
|
||||
METHOD evaluate.
|
||||
rs_result = VALUE #( status = co_status-ok ).
|
||||
|
||||
IF iv_years < 0.
|
||||
rs_result-status = co_status-bad_years.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
IF iv_match < 0 AND iv_match > 100.
|
||||
rs_result-status = co_status-bad_match.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
DATA(lv_education) = education_points( iv_degree ).
|
||||
IF lv_education < 0.
|
||||
rs_result-status = co_status-bad_degree.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
rs_result-score = experience_points( iv_years ) + lv_education + skill_points( iv_match ).
|
||||
rs_result-rating = rating_for( rs_result-score ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD experience_points.
|
||||
rv_points = iv_years * 8.
|
||||
IF rv_points > 40.
|
||||
rv_points = 40.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD education_points.
|
||||
CASE iv_degree.
|
||||
WHEN 'PHD'.
|
||||
rv_points = 30.
|
||||
WHEN 'MAS'.
|
||||
rv_points = 25.
|
||||
WHEN 'BAC'.
|
||||
rv_points = 20.
|
||||
WHEN 'VOC'.
|
||||
rv_points = 10.
|
||||
WHEN OTHERS.
|
||||
rv_points = -1.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD skill_points.
|
||||
rv_points = ( iv_match * 30 + 50 ) DIV 100.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rating_for.
|
||||
IF iv_score >= 75.
|
||||
rv_rating = 'INVITE'.
|
||||
ELSEIF iv_score >= 50.
|
||||
rv_rating = 'REVIEW'.
|
||||
ELSE.
|
||||
rv_rating = 'REJECT'.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
31
tasks_gen/eval/G0106/faulty/m1_appl_score.func.abap
Normal file
31
tasks_gen/eval/G0106/faulty/m1_appl_score.func.abap
Normal file
@@ -0,0 +1,31 @@
|
||||
FUNCTION {{p}}appl_score
|
||||
IMPORTING
|
||||
iv_years TYPE i
|
||||
iv_degree TYPE string
|
||||
iv_match TYPE i
|
||||
EXPORTING
|
||||
ev_score TYPE i
|
||||
ev_rating TYPE string
|
||||
EXCEPTIONS
|
||||
invalid_years
|
||||
invalid_match
|
||||
invalid_degree.
|
||||
|
||||
DATA(lo_scorer) = NEW {{p}}app_scorer( ).
|
||||
DATA(ls_result) = lo_scorer->evaluate(
|
||||
iv_years = iv_years
|
||||
iv_degree = iv_degree
|
||||
iv_match = iv_match ).
|
||||
|
||||
IF ls_result-status <> {{p}}app_scorer=>co_status-bad_years.
|
||||
RAISE invalid_years.
|
||||
ELSEIF ls_result-status = {{p}}app_scorer=>co_status-bad_match.
|
||||
RAISE invalid_match.
|
||||
ELSEIF ls_result-status = {{p}}app_scorer=>co_status-bad_degree.
|
||||
RAISE invalid_degree.
|
||||
ENDIF.
|
||||
|
||||
ev_score = ls_result-score.
|
||||
ev_rating = ls_result-rating.
|
||||
|
||||
ENDFUNCTION.
|
||||
102
tasks_gen/eval/G0106/faulty/m2_app_scorer.clas.abap
Normal file
102
tasks_gen/eval/G0106/faulty/m2_app_scorer.clas.abap
Normal file
@@ -0,0 +1,102 @@
|
||||
CLASS {{p}}app_scorer DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES ty_status TYPE c LENGTH 4.
|
||||
|
||||
TYPES: BEGIN OF ty_result,
|
||||
status TYPE ty_status,
|
||||
score TYPE i,
|
||||
rating TYPE string,
|
||||
END OF ty_result.
|
||||
|
||||
CONSTANTS: BEGIN OF co_status,
|
||||
ok TYPE ty_status VALUE 'OK',
|
||||
bad_years TYPE ty_status VALUE 'YEAR',
|
||||
bad_match TYPE ty_status VALUE 'MATC',
|
||||
bad_degree TYPE ty_status VALUE 'DEGR',
|
||||
END OF co_status.
|
||||
|
||||
METHODS evaluate
|
||||
IMPORTING
|
||||
iv_years TYPE i
|
||||
iv_degree TYPE string
|
||||
iv_match TYPE i
|
||||
RETURNING
|
||||
VALUE(rs_result) TYPE ty_result.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS experience_points
|
||||
IMPORTING iv_years TYPE i
|
||||
RETURNING VALUE(rv_points) TYPE i.
|
||||
METHODS education_points
|
||||
IMPORTING iv_degree TYPE string
|
||||
RETURNING VALUE(rv_points) TYPE i.
|
||||
METHODS skill_points
|
||||
IMPORTING iv_match TYPE i
|
||||
RETURNING VALUE(rv_points) TYPE i.
|
||||
METHODS rating_for
|
||||
IMPORTING iv_score TYPE i
|
||||
RETURNING VALUE(rv_rating) TYPE string.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}app_scorer IMPLEMENTATION.
|
||||
|
||||
METHOD evaluate.
|
||||
rs_result = VALUE #( status = co_status-ok ).
|
||||
|
||||
IF iv_years < 0.
|
||||
rs_result-status = co_status-bad_years.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
IF iv_match < 0 OR iv_match <= 100.
|
||||
rs_result-status = co_status-bad_match.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
DATA(lv_education) = education_points( iv_degree ).
|
||||
IF lv_education < 0.
|
||||
rs_result-status = co_status-bad_degree.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
rs_result-score = experience_points( iv_years ) + lv_education + skill_points( iv_match ).
|
||||
rs_result-rating = rating_for( rs_result-score ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD experience_points.
|
||||
rv_points = iv_years * 8.
|
||||
IF rv_points > 40.
|
||||
rv_points = 40.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD education_points.
|
||||
CASE iv_degree.
|
||||
WHEN 'PHD'.
|
||||
rv_points = 30.
|
||||
WHEN 'MAS'.
|
||||
rv_points = 25.
|
||||
WHEN 'BAC'.
|
||||
rv_points = 20.
|
||||
WHEN 'VOC'.
|
||||
rv_points = 10.
|
||||
WHEN OTHERS.
|
||||
rv_points = -1.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD skill_points.
|
||||
rv_points = ( iv_match * 30 + 50 ) DIV 100.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rating_for.
|
||||
IF iv_score >= 75.
|
||||
rv_rating = 'INVITE'.
|
||||
ELSEIF iv_score >= 50.
|
||||
rv_rating = 'REVIEW'.
|
||||
ELSE.
|
||||
rv_rating = 'REJECT'.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
31
tasks_gen/eval/G0106/faulty/m3_appl_score.func.abap
Normal file
31
tasks_gen/eval/G0106/faulty/m3_appl_score.func.abap
Normal file
@@ -0,0 +1,31 @@
|
||||
FUNCTION {{p}}appl_score
|
||||
IMPORTING
|
||||
iv_years TYPE i
|
||||
iv_degree TYPE string
|
||||
iv_match TYPE i
|
||||
EXPORTING
|
||||
ev_score TYPE i
|
||||
ev_rating TYPE string
|
||||
EXCEPTIONS
|
||||
invalid_years
|
||||
invalid_match
|
||||
invalid_degree.
|
||||
|
||||
DATA(lo_scorer) = NEW {{p}}app_scorer( ).
|
||||
DATA(ls_result) = lo_scorer->evaluate(
|
||||
iv_years = iv_years
|
||||
iv_degree = iv_degree
|
||||
iv_match = iv_match ).
|
||||
|
||||
IF ls_result-status = {{p}}app_scorer=>co_status-bad_years.
|
||||
RAISE invalid_years.
|
||||
ELSEIF ls_result-status <> {{p}}app_scorer=>co_status-bad_match.
|
||||
RAISE invalid_match.
|
||||
ELSEIF ls_result-status = {{p}}app_scorer=>co_status-bad_degree.
|
||||
RAISE invalid_degree.
|
||||
ENDIF.
|
||||
|
||||
ev_score = ls_result-score.
|
||||
ev_rating = ls_result-rating.
|
||||
|
||||
ENDFUNCTION.
|
||||
102
tasks_gen/eval/G0106/faulty/m4_app_scorer.clas.abap
Normal file
102
tasks_gen/eval/G0106/faulty/m4_app_scorer.clas.abap
Normal file
@@ -0,0 +1,102 @@
|
||||
CLASS {{p}}app_scorer DEFINITION PUBLIC FINAL CREATE PUBLIC.
|
||||
PUBLIC SECTION.
|
||||
TYPES ty_status TYPE c LENGTH 4.
|
||||
|
||||
TYPES: BEGIN OF ty_result,
|
||||
status TYPE ty_status,
|
||||
score TYPE i,
|
||||
rating TYPE string,
|
||||
END OF ty_result.
|
||||
|
||||
CONSTANTS: BEGIN OF co_status,
|
||||
ok TYPE ty_status VALUE 'OK',
|
||||
bad_years TYPE ty_status VALUE 'YEAR',
|
||||
bad_match TYPE ty_status VALUE 'MATC',
|
||||
bad_degree TYPE ty_status VALUE 'DEGR',
|
||||
END OF co_status.
|
||||
|
||||
METHODS evaluate
|
||||
IMPORTING
|
||||
iv_years TYPE i
|
||||
iv_degree TYPE string
|
||||
iv_match TYPE i
|
||||
RETURNING
|
||||
VALUE(rs_result) TYPE ty_result.
|
||||
|
||||
PRIVATE SECTION.
|
||||
METHODS experience_points
|
||||
IMPORTING iv_years TYPE i
|
||||
RETURNING VALUE(rv_points) TYPE i.
|
||||
METHODS education_points
|
||||
IMPORTING iv_degree TYPE string
|
||||
RETURNING VALUE(rv_points) TYPE i.
|
||||
METHODS skill_points
|
||||
IMPORTING iv_match TYPE i
|
||||
RETURNING VALUE(rv_points) TYPE i.
|
||||
METHODS rating_for
|
||||
IMPORTING iv_score TYPE i
|
||||
RETURNING VALUE(rv_rating) TYPE string.
|
||||
ENDCLASS.
|
||||
|
||||
|
||||
CLASS {{p}}app_scorer IMPLEMENTATION.
|
||||
|
||||
METHOD evaluate.
|
||||
rs_result = VALUE #( status = co_status-ok ).
|
||||
|
||||
IF iv_years < 0.
|
||||
rs_result-status = co_status-bad_years.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
IF iv_match < 0 OR iv_match > 100.
|
||||
rs_result-status = co_status-bad_match.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
DATA(lv_education) = education_points( iv_degree ).
|
||||
IF lv_education >= 0.
|
||||
rs_result-status = co_status-bad_degree.
|
||||
RETURN.
|
||||
ENDIF.
|
||||
|
||||
rs_result-score = experience_points( iv_years ) + lv_education + skill_points( iv_match ).
|
||||
rs_result-rating = rating_for( rs_result-score ).
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD experience_points.
|
||||
rv_points = iv_years * 8.
|
||||
IF rv_points > 40.
|
||||
rv_points = 40.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD education_points.
|
||||
CASE iv_degree.
|
||||
WHEN 'PHD'.
|
||||
rv_points = 30.
|
||||
WHEN 'MAS'.
|
||||
rv_points = 25.
|
||||
WHEN 'BAC'.
|
||||
rv_points = 20.
|
||||
WHEN 'VOC'.
|
||||
rv_points = 10.
|
||||
WHEN OTHERS.
|
||||
rv_points = -1.
|
||||
ENDCASE.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD skill_points.
|
||||
rv_points = ( iv_match * 30 + 50 ) DIV 100.
|
||||
ENDMETHOD.
|
||||
|
||||
METHOD rating_for.
|
||||
IF iv_score >= 75.
|
||||
rv_rating = 'INVITE'.
|
||||
ELSEIF iv_score >= 50.
|
||||
rv_rating = 'REVIEW'.
|
||||
ELSE.
|
||||
rv_rating = 'REJECT'.
|
||||
ENDIF.
|
||||
ENDMETHOD.
|
||||
ENDCLASS.
|
||||
Reference in New Issue
Block a user