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

Skip to content

Commit b91ea69

Browse files
committed
Fixing SONAR errors
1 parent 2dab607 commit b91ea69

2 files changed

Lines changed: 11 additions & 16 deletions

File tree

source/core/ut_metadata.pkb

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ create or replace package body ut_metadata as
2525
procedure do_resolve(a_owner in out nocopy varchar2, a_object in out nocopy varchar2, a_procedure_name in out nocopy varchar2) is
2626
l_name varchar2(200);
2727
l_context integer := 1; --plsql
28-
l_dblink varchar2(200);
29-
l_part1_type number;
30-
l_object_number number;
3128
begin
3229
l_name := form_name(a_owner, a_object, a_procedure_name);
3330
do_resolve(l_name,l_context,a_owner,a_object, a_procedure_name);
@@ -292,17 +289,12 @@ create or replace package body ut_metadata as
292289

293290
function has_collection_members (a_anydata in anydata) return boolean is
294291
l_anytype anytype;
295-
l_nested_type t_anytype_members_rec;
296292
l_elements_rec t_anytype_elem_info_rec;
297293
l_type_code integer;
298294
begin
299295
l_type_code := a_anydata.gettype(l_anytype);
300296
l_elements_rec := get_attr_elem_info(l_anytype);
301-
if l_elements_rec.attr_elt_type is null then
302-
return false;
303-
else
304-
return true;
305-
end if;
297+
return l_elements_rec.attr_elt_type is not null;
306298
end;
307299

308300
function get_anydata_typename(a_data_value anydata) return varchar2
@@ -333,9 +325,9 @@ create or replace package body ut_metadata as
333325
end;
334326

335327
function get_object_name(a_full_object_name in varchar2) return varchar2 is
336-
l_schema varchar(250);
337-
l_object varchar(250);
338-
l_procedure_name varchar(250);
328+
l_schema varchar2(250);
329+
l_object varchar2(250);
330+
l_procedure_name varchar2(250);
339331
begin
340332
ut_metadata.do_resolve(a_full_object_name,7,l_schema,l_object, l_procedure_name);
341333
return l_object;

source/expectations/data_values/ut_compound_data_helper.pkb

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ create or replace package body ut_compound_data_helper is
9191
|| case when a_order_enforced then ',
9292
row_number() over(partition by case when a.act_col_pos + e.exp_col_pos is not null then 1 end order by a.act_col_pos) a_pos_nn,
9393
row_number() over(partition by case when a.act_col_pos + e.exp_col_pos is not null then 1 end order by e.exp_col_pos) e_pos_nn'
94+
else
95+
null
9496
end ||q'[
9597
from expected_cols e
9698
full outer join actual_cols a
@@ -112,6 +114,8 @@ create or replace package body ut_compound_data_helper is
112114
|| case when a_order_enforced then q'[
113115
--column position is not matching (both when excluded extra/missing columns as well as when they are included)
114116
or (a_pos_nn != e_pos_nn and exp_col_pos != act_col_pos)]'
117+
else
118+
null
115119
end ||q'[
116120
order by exp_col_pos, act_col_pos]'
117121
bulk collect into l_results using a_expected, a_actual;
@@ -312,7 +316,6 @@ create or replace package body ut_compound_data_helper is
312316
l_xmltable_stmt clob;
313317
l_select_stmt clob;
314318
l_partition_stmt clob;
315-
l_equal_stmt clob;
316319
l_join_on_stmt clob;
317320
l_not_equal_stmt clob;
318321
l_where_stmt clob;
@@ -356,10 +359,8 @@ create or replace package body ut_compound_data_helper is
356359
l_compare_sql := replace(l_compare_sql,'{:join_type:}',get_join_type(a_inclusion_type,a_is_negated));
357360
l_compare_sql := replace(l_compare_sql,'{:join_condition:}',l_join_on_stmt);
358361

359-
if l_not_equal_stmt is not null then
360-
if (a_join_by_list.count > 0 and not a_is_negated) or (not a_unordered) then
362+
if l_not_equal_stmt is not null and ((a_join_by_list.count > 0 and not a_is_negated) or (not a_unordered)) then
361363
ut_utils.append_to_clob(l_where_stmt,' ( '||l_not_equal_stmt||' ) or ');
362-
end if;
363364
end if;
364365
--If its inclusion we expect a actual set to fully match and have no extra elements over expected
365366
if a_inclusion_type then
@@ -499,6 +500,8 @@ create or replace package body ut_compound_data_helper is
499500
case when final_order = 1 then to_char(rn) else col_name end,
500501
case when final_order = 1 then to_char(rnk) else col_name end
501502
]'
503+
else
504+
null
502505
end;
503506
execute immediate l_sql
504507
bulk collect into l_results

0 commit comments

Comments
 (0)