Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb9cf97

Browse files
committed
Resolving some sonar violations.
1 parent 59f7738 commit cb9cf97

3 files changed

Lines changed: 11 additions & 23 deletions

File tree

source/core/annotations/ut_annotation_cache_manager.pkb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ create or replace package body ut_annotation_cache_manager as
1818

1919
procedure update_cache(a_object ut_annotated_object) is
2020
l_cache_id integer;
21-
l_current_schema varchar2(250) := ut_utils.ut_owner;
2221
pragma autonomous_transaction;
2322
begin
2423
update ut_annotation_cache_info i

source/core/ut_metadata.pkb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ create or replace package body ut_metadata as
116116
end;
117117

118118
function get_source_definition_line(a_owner varchar2, a_object_name varchar2, a_line_no integer) return varchar2 is
119-
l_cursor sys_refcursor;
120119
l_view_name varchar2(128) := get_dba_view('dba_source');
121120
l_line all_source.text%type;
122121
c_key constant varchar2(500) := a_owner || '.' || a_object_name;

source/core/ut_suite_builder.pkb

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ create or replace package body ut_suite_builder is
5858
gc_endcontext
5959
);
6060

61-
gc_placeholder constant varchar2(3) := '\\%';
62-
6361
gc_integer_exception constant varchar2(1) := 'I';
6462
gc_named_exception constant varchar2(1) := 'N';
6563

@@ -218,7 +216,6 @@ create or replace package body ut_suite_builder is
218216
function get_exception_number (a_exception_var in varchar2) return integer is
219217
l_exc_no integer;
220218
l_exc_type varchar2(50);
221-
l_sql varchar2(32767);
222219
function remap_no_data_found (a_number integer) return integer is
223220
begin
224221
return case a_number when 100 then -1403 else a_number end;
@@ -260,7 +257,7 @@ create or replace package body ut_suite_builder is
260257
l_exception_number_list ut_integer_list := ut_integer_list();
261258
c_regexp_for_exception_no constant varchar2(30) := '^-?[[:digit:]]{1,5}$';
262259
begin
263-
/*the a_expected_error_codes is converted to a ut_varchar2_list after that is trimmed and filtered to left only valid exception numbers*/
260+
--the a_expected_error_codes is converted to a ut_varchar2_list after that is trimmed and filtered to left only valid exception numbers
264261
l_throws_list := ut_utils.trim_list_elements(ut_utils.string_to_table(a_annotation_text, ',', 'Y'));
265262

266263
for i in 1 .. l_throws_list.count
@@ -407,18 +404,15 @@ create or replace package body ut_suite_builder is
407404
a_for_annotation varchar2,
408405
a_procedure_name t_object_name := null
409406
) is
410-
l_annotation_name t_annotation_name;
411407
l_line_no binary_integer;
412408
begin
413-
if a_annotations.exists(a_for_annotation) then
414-
if a_annotations(a_for_annotation).count > 1 then
415-
--start from second occurrence of annotation
416-
l_line_no := a_annotations(a_for_annotation).next( a_annotations(a_for_annotation).first );
417-
while l_line_no is not null loop
418-
add_annotation_ignored_warning( a_suite, a_for_annotation, 'Duplicate annotation %%%.', l_line_no, a_procedure_name );
419-
l_line_no := a_annotations(a_for_annotation).next( l_line_no );
420-
end loop;
421-
end if;
409+
if a_annotations.exists(a_for_annotation) and a_annotations(a_for_annotation).count > 1 then
410+
--start from second occurrence of annotation
411+
l_line_no := a_annotations(a_for_annotation).next( a_annotations(a_for_annotation).first );
412+
while l_line_no is not null loop
413+
add_annotation_ignored_warning( a_suite, a_for_annotation, 'Duplicate annotation %%%.', l_line_no, a_procedure_name );
414+
l_line_no := a_annotations(a_for_annotation).next( l_line_no );
415+
end loop;
422416
end if;
423417
end;
424418

@@ -430,8 +424,7 @@ create or replace package body ut_suite_builder is
430424
a_invalid_annotations ut_varchar2_list
431425
) is
432426
l_annotation_name t_annotation_name;
433-
l_warning varchar2(32767);
434-
l_line_no binary_integer;
427+
l_line_no binary_integer;
435428
begin
436429
if a_proc_annotations.exists(a_for_annotation) then
437430
l_annotation_name := a_proc_annotations.first;
@@ -739,9 +732,8 @@ create or replace package body ut_suite_builder is
739732

740733
while l_context_pos is not null loop
741734
l_end_context_pos := get_endcontext_position(l_context_pos, a_annotations.by_name );
742-
if l_end_context_pos is null then
743-
exit;
744-
end if;
735+
736+
exit when l_end_context_pos is null;
745737

746738
l_context_items := ut_suite_items();
747739
--create a sub-set of annotations to process as sub-suite (context)
@@ -1156,10 +1148,8 @@ create or replace package body ut_suite_builder is
11561148
a_skip_all_objects boolean := false
11571149
) return ut_suite_items is
11581150
l_suites ut_suite_items;
1159-
l_annotations_cursor sys_refcursor;
11601151
l_annotated_objects ut_annotated_objects;
11611152
l_suite_items ut_suite_items;
1162-
l_suite_data_cursor sys_refcursor;
11631153
begin
11641154
loop
11651155
fetch a_annotated_objects bulk collect into l_annotated_objects limit 10;

0 commit comments

Comments
 (0)