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
Trim spaces
  • Loading branch information
lwasylow committed Mar 15, 2026
commit 65145c2381762d2f0acf0ffe3aab602b86273c31
14 changes: 7 additions & 7 deletions source/core/ut_utils.pkb
Original file line number Diff line number Diff line change
Expand Up @@ -682,10 +682,10 @@
end if;

-- Fast pre-scan to check for presence of multi-line comments; if none, return original source unmodified
for i in 1 .. a_source.count loop

Check failure on line 685 in source/core/ut_utils.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=AZzvRFHIwAnQ9xtGVyea&open=AZzvRFHIwAnQ9xtGVyea&pullRequest=1312
if instr(a_source(i), '/*') > 0 then
l_has_ml_comment := true;
exit;

Check warning on line 688 in source/core/ut_utils.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=AZzvRFHIwAnQ9xtGVyeb&open=AZzvRFHIwAnQ9xtGVyeb&pullRequest=1312
end if;
end loop;

Expand All @@ -693,7 +693,7 @@
return a_source;
end if;

for i in 1 .. a_source.count loop

Check failure on line 696 in source/core/ut_utils.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=AZzvRFHIwAnQ9xtGVyec&open=AZzvRFHIwAnQ9xtGVyec&pullRequest=1312
l_line := a_source(i);

-- Fast path: inside multi-line comment
Expand Down Expand Up @@ -723,11 +723,11 @@
l_line := null;

<<scan_line>>
Comment thread
lwasylow marked this conversation as resolved.
Outdated
loop

Check failure on line 726 in source/core/ut_utils.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=AZzvRFHIwAnQ9xtGVyed&open=AZzvRFHIwAnQ9xtGVyed&pullRequest=1312
exit when l_remaining is null or l_remaining = '';

Check warning on line 727 in source/core/ut_utils.pkb

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This EXIT statement should explicitly mention the loop label.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL&issues=AZzvRFHIwAnQ9xtGVyee&open=AZzvRFHIwAnQ9xtGVyee&pullRequest=1312

Check warning on line 727 in source/core/ut_utils.pkb

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Use IS NULL and IS NOT NULL instead of direct NULL comparisons.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL&issues=AZzvRFHIwAnQ9xtGVyef&open=AZzvRFHIwAnQ9xtGVyef&pullRequest=1312
Comment thread
lwasylow marked this conversation as resolved.
Outdated
l_ml_start := instr(l_remaining, '/*');
l_ml_start := instr(l_remaining, '/*');
l_comment_start := instr(l_remaining, '--');
l_text_start := instr(l_remaining, '''');
l_text_start := instr(l_remaining, '''');
-- q' always puts ' at l_text_start; just check the char immediately before it
l_eq_text_start := case
when l_text_start > 1 and substr(l_remaining, l_text_start - 1, 1) = 'q'
Expand All @@ -736,9 +736,9 @@
end;
-- Sentinel gc_max_plsql_source_len means "not present"; 32767 is beyond any VARCHAR2 position
l_pos := least(
case when l_ml_start > 0 then l_ml_start else gc_max_plsql_source_len end,
case when l_ml_start > 0 then l_ml_start else gc_max_plsql_source_len end,
case when l_comment_start > 0 then l_comment_start else gc_max_plsql_source_len end,
case when l_text_start > 0 then l_text_start else gc_max_plsql_source_len end,
case when l_text_start > 0 then l_text_start else gc_max_plsql_source_len end,
case when l_eq_text_start > 0 then l_eq_text_start else gc_max_plsql_source_len end
);

Expand All @@ -747,15 +747,15 @@
exit scan_line;
end if;

l_line := l_line || substr(l_remaining, 1, l_pos - 1);
l_line := l_line || substr(l_remaining, 1, l_pos - 1);
l_remaining := substr(l_remaining, l_pos);
-- l_remaining now starts exactly at the token; all branch offsets below are relative to 1
if l_pos = l_eq_text_start then
-- q-quoted string: l_remaining starts at 'q', delimiter is at position 3
l_eq_end_char := translate(substr(l_remaining, 3, 1), gc_open_chars, gc_close_chars);
l_end := instr(l_remaining, l_eq_end_char || '''', 4);
if l_end > 0 then
l_line := l_line || substr(l_remaining, 1, l_end + 1);
l_line := l_line || substr(l_remaining, 1, l_end + 1);
l_remaining := substr(l_remaining, l_end + 2);
else
l_line := l_line || l_remaining;
Expand All @@ -781,18 +781,18 @@
-- Regular string literal: l_remaining starts at the opening quote
-- scan from position 2 to skip the opening quote
l_end := 2;
loop

Check failure on line 784 in source/core/ut_utils.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=AZzvRFHIwAnQ9xtGVyeg&open=AZzvRFHIwAnQ9xtGVyeg&pullRequest=1312
l_end := instr(l_remaining, '''', l_end);
exit when l_end = 0;

Check warning on line 786 in source/core/ut_utils.pkb

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This EXIT statement should explicitly mention the loop label.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL&issues=AZzvRFHIwAnQ9xtGVyeh&open=AZzvRFHIwAnQ9xtGVyeh&pullRequest=1312
if substr(l_remaining, l_end, 2) = '''''' then
l_end := l_end + 2; -- skip escaped quote pair
else
exit; -- real closing quote

Check warning on line 790 in source/core/ut_utils.pkb

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

This EXIT statement should explicitly mention the loop label.

See more on https://sonarcloud.io/project/issues?id=utPLSQL_utPLSQL&issues=AZzvRFHIwAnQ9xtGVyei&open=AZzvRFHIwAnQ9xtGVyei&pullRequest=1312
end if;
end loop;

if l_end > 0 then
l_line := l_line || substr(l_remaining, 1, l_end);
l_line := l_line || substr(l_remaining, 1, l_end);
l_remaining := substr(l_remaining, l_end + 1);
else
l_line := l_line || l_remaining;
Expand Down
Loading