Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
38e02ab
Testing something
lwasylow Mar 9, 2026
461ad5d
Another test
lwasylow Mar 9, 2026
44f5495
Test
lwasylow Mar 9, 2026
b5f2dc7
Thats funny:)
lwasylow Mar 9, 2026
0dd7dba
that is rubbish
lwasylow Mar 9, 2026
4ea0fcb
revert test
lwasylow Mar 9, 2026
17604d8
Small tweaks
lwasylow Mar 9, 2026
5869f32
one at the time
lwasylow Mar 9, 2026
3f8d2cf
Move out outside
lwasylow Mar 9, 2026
37fae24
fix invalid locator
lwasylow Mar 9, 2026
5189955
revert
lwasylow Mar 9, 2026
5a21774
Changing a code to validate by lines instead of clobs for performance.
lwasylow Mar 14, 2026
39f5d64
Fixing loop syntax
lwasylow Mar 14, 2026
93ffb72
Merge branch 'develop' of https://github.com/utPLSQL/utPLSQL into fea…
lwasylow Mar 14, 2026
393cfec
Update code
lwasylow Mar 15, 2026
8d794f0
Update block
lwasylow Mar 15, 2026
a32e09d
Small fixes
lwasylow Mar 15, 2026
b2e914f
Update comment
lwasylow Mar 15, 2026
66de806
Introduce global variable
lwasylow Mar 15, 2026
f82a3b5
Cleanup
lwasylow Mar 15, 2026
934df67
Optimization fiurther
lwasylow Mar 15, 2026
65145c2
Trim spaces
lwasylow Mar 15, 2026
8105179
Added extra tests.
lwasylow Mar 15, 2026
cc491cf
Enhance annotation parser with new tests and source line handling fun…
lwasylow Mar 15, 2026
6717ad3
Add tests for Windows-style newlines and long procedure names in anno…
lwasylow Mar 15, 2026
6c513be
Fix regex extraction for procedure/function names and ensure ordered …
lwasylow Mar 15, 2026
46f3d12
Update tests
lwasylow Mar 15, 2026
81e1752
Refactor annotation parser tests and utility functions
lwasylow Mar 16, 2026
fecbcc1
Remove redundant parse_object_annotations function overloads and upda…
lwasylow Mar 16, 2026
2547b40
Update code to avoid
lwasylow Mar 17, 2026
40eb166
Enhance annotation processing by improving SQL text handling and addi…
lwasylow Mar 17, 2026
1cdeb9c
Refactor annotation processing and enhance line scanning functionalit…
lwasylow Mar 18, 2026
c4d0ab0
Remove redundant exception handling in build_annot_cache_for_sources …
lwasylow Mar 18, 2026
aa3bfe7
Refactor annotation patterns in ut_annotation_parser and remove unuse…
lwasylow Mar 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix regex extraction for procedure/function names and ensure ordered …
…results in annotation processing
  • Loading branch information
lwasylow committed Mar 15, 2026
commit 6c513bea386d9880250938818fc2fd3c8beae3d4
4 changes: 2 additions & 2 deletions source/core/annotations/ut_annotation_parser.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
begin

-- loop while there are unprocessed comment blocks
loop

Check failure on line 79 in source/core/annotations/ut_annotation_parser.pkb

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Simple loops of the form LOOP .. END LOOP; should be avoid as they behave by default as infinite loops.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL&issues=AZzvRFGIwAnQ9xtGVyeU&open=AZzvRFGIwAnQ9xtGVyeU&pullRequest=1312
-- define index of the comment block and get it's content from cache
l_annotation_index := regexp_substr( a_source ,gc_comment_replacer_regex_ptrn ,1 ,l_loop_index ,subexpression => 1);
exit when l_annotation_index is null;
Expand Down Expand Up @@ -160,7 +160,7 @@
and regexp_like(l_line, '^\s*(procedure|function)\s+', 'i')
then
-- extract just the identifier name (subexpression 2)
l_proc_name := trim(regexp_substr(l_line
l_proc_name := trim(regexp_substr(srcstr =>l_line
,pattern => '^\s*(procedure|function)\s+('||gc_regexp_identifier||')'
,modifier => 'i'
,subexpression => 2));
Expand All @@ -175,7 +175,7 @@
-- advance past proc header to the terminating ';'
-- the header may span multiple lines e.g. with multi-line parameter lists
while l_i <= a_source.count loop
exit when instr(a_source(l_i), ';') > 0;

Check warning on line 178 in source/core/annotations/ut_annotation_parser.pkb

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Avoid using EXIT from within a FOR or WHILE loop.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL&issues=AZzvRFGIwAnQ9xtGVyeW&open=AZzvRFGIwAnQ9xtGVyeW&pullRequest=1312
Comment thread
lwasylow marked this conversation as resolved.
l_i := l_i + 1;
end loop;
l_i := l_i + 1; -- step past the ';' line itself
Expand Down Expand Up @@ -237,7 +237,7 @@
return l_comments;
end extract_and_replace_comments;

function extract_and_replace_comments(

Check warning on line 240 in source/core/annotations/ut_annotation_parser.pkb

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This function should be rewritten to not depend on OUT parameters.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL&issues=AZzvRFGIwAnQ9xtGVyeX&open=AZzvRFGIwAnQ9xtGVyeX&pullRequest=1312
a_source in out nocopy dbms_preprocessor.source_lines_t
) return tt_comment_list is
l_comments tt_comment_list;
Expand All @@ -245,7 +245,7 @@
l_comment_pos binary_integer;
l_comment_replacer varchar2(50);
begin
for i in 1 .. a_source.count loop

Check failure on line 248 in source/core/annotations/ut_annotation_parser.pkb

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace this FOR loop by a more robust WHILE one.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL&issues=AZzvRFGIwAnQ9xtGVyeY&open=AZzvRFGIwAnQ9xtGVyeY&pullRequest=1312
l_line := a_source(i);

-- fast path: skip lines that can't possibly match
Expand Down Expand Up @@ -310,7 +310,7 @@
l_comment_index := l_comments.next(l_comment_index);
end loop;

select /*+ no_parallel */ value(x) bulk collect into l_result from table(l_annotations) x order by x.position;
select /*+ no_parallel */ value(x) bulk collect into l_result from table(l_annotations) x order by x.position asc;

return l_result;

Expand Down
Loading