Copyright 2010-2022 by Trivadis AG
Saegereistrasse 29 CH-8152 Glattbrugg (Zurich) www.trivadis.com |
Philipp Salvisberg, Trivadis AG, CH-8152 Glattbrugg | |
valid thru | 9999-12-31 |
valid for versions less than | 5 |
max. files | unlimited |
max. lines | unlimited |
max. commands | unlimited |
max. bytes | unlimited |
limited to | personal use |
path | /usr/local/bin/tvdcc/sample |
filter | (sql|prc|fnc|pks|pkb|trg|vw|tps|tpb|tbp|plb|pls|rcv|spc|typ|aqt|aqp|ctx|dbl|tab|dim|snp|con|collt|seq|syn|grt|sp|spb|sps|pck|md|mdown)$ |
timeout | 10 |
complexity | 4 |
output | /usr/local/bin/tvdcc/./tvdcc_report.html |
template | html.xsl |
excel | true |
html | true |
transonly | false |
cleanup | true |
check | |
skip | 0000,1050,2130,3160,3170,5010,7170,7460,7740,8410,8510 |
nosonar | true |
license | |
validator | com.trivadis.tvdcc.validators.TrivadisGuidelines3 |
genmodel | false |
Start of processing | 2022-09-02 11:54:21 |
End of processing | 2022-09-02 11:54:27 |
Processing time in seconds | 5.768 |
Number of files | 122 | |||||
Number of bytes | 227,509 | |||||
Number of lines (LOC) | 9,413 | |||||
Number of comment lines | 1,169 | |||||
Number of blank lines | 1,428 | |||||
Number of net lines | 6,816 | |||||
Number of commands | 298 | |||||
Number of statements (PL/SQL) | 1,584 | |||||
Max. cyclomatic complexity | 5 | ( < 11 | 11..50 | > 50 | ) | |
Max. Halstead volume | 575 | ( < 1001 | 1001..3000 | > 3000 | ) | |
Min. maintainability index (MI) | 82 | ( > 84 | 64..84 | < 64 | ) | |
Number of issues | 298 | |||||
Number of warnings | 298 | |||||
Number of errors | 0 |
# | % | Severity | Characteristics | Message |
---|---|---|---|---|
1 | 0.3% | Blocker | Portability, Reliability | |
1 | 0.3% | Blocker | Reliability, Testability | |
1 | 0.3% | Blocker | Reliability, Testability | |
2 | 0.7% | Critical | Reliability | |
2 | 0.7% | Critical | Testability | |
1 | 0.3% | Critical | Reliability | |
1 | 0.3% | Critical | Reliability | |
1 | 0.3% | Critical | Reliability | |
1 | 0.3% | Critical | Efficiency, Reliability | |
1 | 0.3% | Critical | Efficiency, Reliability | |
1 | 0.3% | Critical | Maintainability | |
13 | 4.4% | Major | Maintainability, Testability | |
11 | 3.7% | Major | Maintainability | |
6 | 2.0% | Major | Changeability, Maintainability | |
5 | 1.7% | Major | Efficiency | |
4 | 1.3% | Major | Maintainability | |
4 | 1.3% | Major | Maintainability | |
4 | 1.3% | Major | Efficiency, Maintainability | |
3 | 1.0% | Major | Maintainability | |
3 | 1.0% | Major | Maintainability, Reliability, Testability | |
3 | 1.0% | Major | Changeability, Reliability | |
3 | 1.0% | Major | Reliability | |
3 | 1.0% | Major | Reliability | |
3 | 1.0% | Major | Maintainability, Reliability, Testability | |
3 | 1.0% | Major | Reliability | |
2 | 0.7% | Major | Portability | |
2 | 0.7% | Major | Maintainability, Reliability | |
2 | 0.7% | Major | Changeability, Reliability | |
2 | 0.7% | Major | Efficiency | |
2 | 0.7% | Major | Maintainability, Testability | |
2 | 0.7% | Major | Maintainability, Testability | |
2 | 0.7% | Major | Efficiency | |
1 | 0.3% | Major | Reliability | |
1 | 0.3% | Major | Maintainability, Reliability | |
1 | 0.3% | Major | Reliability | |
1 | 0.3% | Major | Portability, Reliability | |
1 | 0.3% | Major | Reliability | |
1 | 0.3% | Major | Portability | |
1 | 0.3% | Major | Portability | |
1 | 0.3% | Major | Maintainability, Reliability | |
1 | 0.3% | Major | Testability | |
1 | 0.3% | Major | Testability | |
1 | 0.3% | Major | Reusability, Testability | |
1 | 0.3% | Major | Efficiency, Reliability | |
1 | 0.3% | Major | Reliability | |
1 | 0.3% | Major | Maintainability, Testability | |
1 | 0.3% | Major | Reliability, Testability | |
1 | 0.3% | Major | Maintainability, Testability | |
1 | 0.3% | Major | Reliability, Testability | |
1 | 0.3% | Major | Reliability | |
1 | 0.3% | Major | Efficiency | |
1 | 0.3% | Major | Changeability, Maintainability | |
1 | 0.3% | Major | Maintainability, Testability | |
1 | 0.3% | Major | Maintainability, Reliability | |
1 | 0.3% | Major | Maintainability, Testability | |
1 | 0.3% | Major | Testability | |
1 | 0.3% | Major | Maintainability | |
1 | 0.3% | Major | Reusability | |
1 | 0.3% | Major | Reliability, Testability | |
1 | 0.3% | Major | Security | |
1 | 0.3% | Major | Efficiency, Maintainability | |
1 | 0.3% | Major | Efficiency, Reliability | |
1 | 0.3% | Major | Changeability, Maintainability | |
1 | 0.3% | Major | Maintainability, Reliability, Security, Testability | |
1 | 0.3% | Major | Maintainability, Reliability, Security, Testability | |
76 | 25.5% | Minor | Maintainability, Reliability, Reusability, Testability | |
7 | 2.3% | Minor | Reliability, Testability | |
6 | 2.0% | Minor | Maintainability | |
5 | 1.7% | Minor | Maintainability | |
4 | 1.3% | Minor | Efficiency, Maintainability | |
4 | 1.3% | Minor | Maintainability | |
4 | 1.3% | Minor | Testability | |
3 | 1.0% | Minor | Maintainability | |
3 | 1.0% | Minor | Maintainability, Reliability | |
3 | 1.0% | Minor | Maintainability | |
3 | 1.0% | Minor | Maintainability | |
3 | 1.0% | Minor | Changeability, Maintainability | |
3 | 1.0% | Minor | Maintainability | |
3 | 1.0% | Minor | Maintainability | |
3 | 1.0% | Minor | Reliability | |
2 | 0.7% | Minor | Maintainability | |
2 | 0.7% | Minor | Maintainability | |
2 | 0.7% | Minor | Maintainability | |
2 | 0.7% | Minor | Efficiency | |
2 | 0.7% | Minor | Efficiency | |
2 | 0.7% | Minor | Reliability | |
2 | 0.7% | Minor | Maintainability, Portability | |
2 | 0.7% | Minor | Maintainability | |
2 | 0.7% | Minor | Efficiency, Maintainability | |
2 | 0.7% | Minor | Changeability | |
1 | 0.3% | Minor | Efficiency, Testability | |
1 | 0.3% | Minor | Changeability | |
1 | 0.3% | Minor | Maintainability | |
1 | 0.3% | Minor | Efficiency | |
1 | 0.3% | Minor | Maintainability | |
1 | 0.3% | Minor | Maintainability, Portability, Reusability | |
1 | 0.3% | Minor | Maintainability | |
1 | 0.3% | Minor | Maintainability, Portability | |
1 | 0.3% | Minor | Maintainability | |
1 | 0.3% | Minor | Maintainability | |
1 | 0.3% | Minor | Testability | |
1 | 0.3% | Minor | Testability | |
1 | 0.3% | Minor | Maintainability | |
1 | 0.3% | Minor | Efficiency | |
1 | 0.3% | Minor | Testability | |
1 | 0.3% | Minor | Maintainability | |
1 | 0.3% | Minor | Maintainability | |
1 | 0.3% | Minor | Efficiency, Maintainability | |
1 | 0.3% | Minor | Maintainability | |
1 | 0.3% | Minor | Maintainability |
File name | PL/SQL Unit | Line | # Lines | # Comment lines | # Blank lines | # Net lines | # Stmts | Cyclomatic complexity | Halstead volume | Maintainability index |
---|---|---|---|---|---|---|---|---|---|---|
guidelines/guideline_1040_04.sql | AnonymousPlsqlBlock | 10 | 31 | 1 | 6 | 31 | 14 | 5 | 349 | 93 |
guidelines/guideline_4370_45.sql | AnonymousPlsqlBlock | 14 | 29 | 0 | 3 | 29 | 13 | 5 | 411 | 82 |
guidelines/guideline_4310_39.sql | my_package.password_check | 26 | 21 | 0 | 3 | 21 | 10 | 5 | 492 | 86 |
guidelines/guideline_4310_39.sql | my_package.password_check | 63 | 21 | 0 | 3 | 21 | 10 | 5 | 492 | 86 |
guidelines/guideline_4320_40.sql | AnonymousPlsqlBlock | 12 | 18 | 0 | 3 | 18 | 9 | 5 | 289 | 91 |
guidelines/guideline_4320_40.sql | AnonymousPlsqlBlock | 41 | 25 | 0 | 3 | 25 | 9 | 5 | 346 | 85 |
guidelines/guideline_4370_45.sql | AnonymousPlsqlBlock | 54 | 25 | 0 | 3 | 25 | 9 | 5 | 346 | 85 |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 17 | Major | G-7110: Try to use named notation when calling program units. | in_customer_id |
2 | 17 | Major | G-7110: Try to use named notation when calling program units. | in_discount |
3 | 36 | Major | G-7110: Try to use named notation when calling program units. | in_customer_id |
4 | 36 | Major | G-7110: Try to use named notation when calling program units. | in_discount |
5 | 23 | Minor | G-5080: Always use FORMAT_ERROR_BACKTRACE when using FORMAT_ERROR_STACK or SQLERRM. | sqlerrm |
6 | 13 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_customer_id in customer.id%type |
7 | 14 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_discount in customer.discount_percentage%type |
8 | 32 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_customer_id in customer.id%type |
9 | 33 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_discount in customer.discount_percentage%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 20 | Major | G-9010: Always use a format model in string to date/time conversion functions. | to_date(in_dob_str) |
2 | 16 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
3 | 17 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dob_str in varchar2 |
4 | 28 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
5 | 29 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dob_str in varchar2 |
6 | 20 | Minor | G-9030: Try to define a default value on conversion errors. | to_date(in_dob_str) |
7 | 32 | Minor | G-9030: Try to define a default value on conversion errors. | to_date(in_dob_str,'YYYY-MM-DD') |
8 | 32 | Minor | G-9040: Try using FX in string to date/time conversion format model to avoid fuzzy conversion. | 'YYYY-MM-DD' |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 36 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit basic_loop |
2 | 73 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit basic_loop |
3 | 17 | Minor | G-1020: Always have a matching loop or block label. | <<prepare_data>> |
4 | 22 | Minor | G-1020: Always have a matching loop or block label. | <<process_data>> |
5 | 28 | Minor | G-1020: Always have a matching loop or block label. | <<while_loop>> |
6 | 34 | Minor | G-1020: Always have a matching loop or block label. | <<basic_loop>> |
7 | 39 | Minor | G-1020: Always have a matching loop or block label. | <<for_loop>> |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 14 | Major | G-3210: Always use BULK OPERATIONS (BULK COLLECT, FORALL) whenever you have to execute a DML statement for more than 4 times. | for l_counter in 1..5 loop insert into headers (id,text) values (l_counter,'Number ' || l_counter); insert into lines (header_id,line_no,text) select l_counter,rownum,'Line ' || rownum from dual connect by level <= 3; commit; end loop create_headers |
2 | 16 | Major | G-3210: Always use BULK OPERATIONS (BULK COLLECT, FORALL) whenever you have to execute a DML statement for more than 4 times. | for l_counter in 1..5 loop insert into headers (id,text) values (l_counter,'Number ' || l_counter); insert into lines (header_id,line_no,text) select l_counter,rownum,'Line ' || rownum from dual connect by level <= 3; commit; end loop create_headers |
3 | 21 | Major | G-3320: Try to move transactions within a non-cursor loop into procedures. | commit |
4 | 12 | Minor | G-4395: Avoid hard-coded upper or lower bound values with FOR loops. | 1..5 |
5 | 43 | Minor | G-4395: Avoid hard-coded upper or lower bound values with FOR loops. | 1..5 |
6 | 28 | Minor | G-7120: Always add the name of the program unit to its end keyword. | create_rows |
7 | 29 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | p_header_id in headers.id%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 38 | Major | G-4310: Never use GOTO statements in your code. | goto check_other_things |
2 | 75 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit check_digit |
3 | 75 | Major | G-4370: Avoid using EXIT to stop loop processing unless you are in a basic loop. | exit check_digit |
4 | 75 | Minor | G-4375: Always use EXIT WHEN instead of an IF statement to exit from a loop. | exit check_digit |
5 | 18 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_password in varchar2 |
6 | 55 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_password in varchar2 |
7 | 92 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_password in varchar2 |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 20 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit |
2 | 51 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit basic_loop |
3 | 14 | Minor | G-4320: Always label your loops. | while (i <= co_max_value) loop i := i + co_increment; end loop |
4 | 19 | Minor | G-4320: Always label your loops. | loop exit; end loop |
5 | 23 | Minor | G-4320: Always label your loops. | for i in co_min_value..co_max_value loop sys.dbms_output.put_line(i); end loop |
6 | 28 | Minor | G-4320: Always label your loops. | for r_employee in (select last_name from employees) loop sys.dbms_output.put_line(r_employee.last_name); end loop |
7 | 20 | Minor | G-4380: Try to label your EXIT WHEN statements. | exit |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 22 | Major | G-7130: Always use parameters or pull in definitions rather than referencing external variables in a local program unit. | r_emp |
2 | 23 | Major | G-7130: Always use parameters or pull in definitions rather than referencing external variables in a local program unit. | r_emp |
3 | 23 | Major | G-7130: Always use parameters or pull in definitions rather than referencing external variables in a local program unit. | r_emp |
4 | 16 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
5 | 46 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
6 | 49 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_salary in employees.salary%type |
7 | 50 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_comm_pct in employees.commission_pct%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 38 | Major | G-5040: Avoid use of WHEN OTHERS clause in an exception section without any other specific handlers. | when others then -- log error lock_up.release_lock(in_lock_name => co_lock_name); raise; |
2 | 89 | Major | G-5040: Avoid use of WHEN OTHERS clause in an exception section without any other specific handlers. | when others then -- log error lock_up.release_lock(in_lock_handle => l_handle); raise; |
3 | 17 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_lock_name in varchar2 |
4 | 23 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_lock_name in varchar2 |
5 | 49 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_lock_name in varchar2 |
6 | 50 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_release_on_commit in boolean := false |
7 | 71 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_lock_handle in varchar2 |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 22 | Major | G-9020: Try to use a format model and NLS_NUMERIC_CHARACTERS in string to number conversion functions. | to_number(in_salary) |
2 | 18 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
3 | 19 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_salary in varchar2 |
4 | 30 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
5 | 31 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_salary in varchar2 |
6 | 22 | Minor | G-9030: Try to define a default value on conversion errors. | to_number(in_salary) |
7 | 34 | Minor | G-9030: Try to define a default value on conversion errors. | to_number(in_salary,'99999999999999999999.99999',q'[nls_numeric_characters='.,']') |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 14 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
2 | 15 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dob_str in varchar2 |
3 | 27 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
4 | 28 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dob_str in varchar2 |
5 | 18 | Minor | G-9030: Try to define a default value on conversion errors. | to_date(in_dob_str,'YYYY-MM-DD') |
6 | 18 | Minor | G-9040: Try using FX in string to date/time conversion format model to avoid fuzzy conversion. | 'YYYY-MM-DD' |
7 | 31 | Minor | G-9040: Try using FX in string to date/time conversion format model to avoid fuzzy conversion. | 'YYYY-MM-DD' |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 16 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
2 | 17 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dob_str in varchar2 |
3 | 28 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
4 | 29 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dob_str in varchar2 |
5 | 20 | Minor | G-9030: Try to define a default value on conversion errors. | to_date(in_dob_str,'YYYY-MM-DD') |
6 | 32 | Minor | G-9030: Try to define a default value on conversion errors. | to_date(in_dob_str,'FXYYYY-MM-DD') |
7 | 20 | Minor | G-9040: Try using FX in string to date/time conversion format model to avoid fuzzy conversion. | 'YYYY-MM-DD' |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 19 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit my_loop |
2 | 11 | Minor | G-1040: Avoid dead code. | 2 = 3 |
3 | 19 | Minor | G-1040: Avoid dead code. | exit my_loop |
4 | 26 | Minor | G-1040: Avoid dead code. | 'x' = 'y' |
5 | 38 | Minor | G-1040: Avoid dead code. | 5 = 6 |
6 | 45 | Minor | G-1040: Avoid dead code. | return |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 10 | Major | G-2510: Avoid using the LONG and LONG RAW data types. | g_long long; |
2 | 11 | Major | G-2510: Avoid using the LONG and LONG RAW data types. | g_raw long raw; |
3 | 10 | Major | G-7230: Avoid declaring global variables public. | g_long |
4 | 11 | Major | G-7230: Avoid declaring global variables public. | g_raw |
5 | 32 | Minor | G-1030: Avoid defining variables that are not used. | g_long |
6 | 33 | Minor | G-1030: Avoid defining variables that are not used. | g_raw |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 25 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit basic_loop |
2 | 43 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit process_employees |
3 | 64 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit basic_loop |
4 | 20 | Major | G-4370: Avoid using EXIT to stop loop processing unless you are in a basic loop. | exit while_loop when i > co_max_value |
5 | 32 | Major | G-4370: Avoid using EXIT to stop loop processing unless you are in a basic loop. | exit for_loop when i = co_max_value |
6 | 43 | Major | G-4370: Avoid using EXIT to stop loop processing unless you are in a basic loop. | exit process_employees |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 14 | Minor | G-7220: Always use forward declaration for private functions and procedures. | does_exist |
2 | 14 | Minor | G-7220: Always use forward declaration for private functions and procedures. | does_exist |
3 | 14 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_department_id in departments.department_id%type |
4 | 32 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_department_id in departments.department_id%type |
5 | 51 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_department_id in departments.department_id%type |
6 | 58 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_department_id in departments.department_id%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 18 | Critical | G-7910: Never use DML within a SQL macro. | insert |
2 | 20 | Critical | G-7910: Never use DML within a SQL macro. | commit |
3 | 13 | Minor | G-7410: Avoid standalone functions – put your functions in packages. | row_generator |
4 | 29 | Minor | G-7410: Avoid standalone functions – put your functions in packages. | row_generator |
5 | 14 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_num_rows in number |
6 | 30 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_num_rows in number |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | "sal+comm" := "my constant" |
2 | 25 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_sal_comm := co_my_constant |
3 | 8 | Major | G-2180: Never use quoted identifiers. | "sal+comm" |
4 | 9 | Major | G-2180: Never use quoted identifiers. | "my constant" |
5 | 10 | Major | G-2180: Never use quoted identifiers. | "my exception" |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 14 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | i := c |
2 | 27 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_sal_comm := co_my_constant |
3 | 10 | Minor | G-2185: Avoid using overly short names for explicitly or implicitly declared identifiers. | i integer; |
4 | 11 | Minor | G-2185: Avoid using overly short names for explicitly or implicitly declared identifiers. | c constant integer := 1; |
5 | 12 | Minor | G-2185: Avoid using overly short names for explicitly or implicitly declared identifiers. | e exception; |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 32 | Major | G-4140: Avoid executing any statements between a SQL operation and the usage of an implicit cursor attribute. | sql%rowcount |
2 | 18 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dept_id in departments.department_id%type |
3 | 23 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
4 | 44 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dept_id in departments.department_id%type |
5 | 49 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 22 | Minor | G-6020: Try to use output bind arguments in the RETURNING INTO clause of dynamic DML statements rather than the USING clause. | out out_new_salary |
2 | 12 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
3 | 13 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_increase_pct in types_up.percentage |
4 | 29 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
5 | 30 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_increase_pct in types_up.percentage |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 16 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_message := 'Hello, ' || in_name |
2 | 12 | Major | G-7330: Always assign values to OUT parameters. | out_greeting |
3 | 12 | Minor | G-7150: Try to remove unused parameters. | out_greeting out varchar2 |
4 | 11 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_name in varchar2 |
5 | 24 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_name in varchar2 |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 18 | Major | G-7420: Always make the RETURN statement the last statement of your function. | return l_ret |
2 | 8 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_from in pls_integer |
3 | 9 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_to in pls_integer |
4 | 27 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_from in pls_integer |
5 | 28 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_to in pls_integer |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Major | G-7430: Try to use no more than one RETURN statement within a function. | return true |
2 | 14 | Major | G-7430: Try to use no more than one RETURN statement within a function. | return false |
3 | 8 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_value in pls_integer |
4 | 22 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_value in pls_integer |
5 | 39 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_value in pls_integer |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 14 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_bigger := constants_up.co_numeric_true |
2 | 28 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_bigger := true |
3 | 41 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_bigger := nvl(co_newfile < co_oldfile,false) |
4 | 11 | Minor | G-2410: Try to use boolean data type for values with dual meaning. (co_numeric_false, co_numeric_true). | l_bigger pls_integer; |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Major | G-3120: Always use table aliases when your SQL statement involves more than one source. | last_name |
2 | 10 | Major | G-3120: Always use table aliases when your SQL statement involves more than one source. | first_name |
3 | 11 | Major | G-3120: Always use table aliases when your SQL statement involves more than one source. | department_name |
4 | 24 | Major | G-3120: Always use table aliases when your SQL statement involves more than one source. | employee_id |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 10 | Minor | G-7120: Always add the name of the program unit to its end keyword. | employee_api |
2 | 11 | Minor | G-7120: Always add the name of the program unit to its end keyword. | employee_by_id |
3 | 11 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
4 | 32 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Minor | G-7150: Try to remove unused parameters. | in_manager_id in departments.manager_id%type |
2 | 8 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_department_id in departments.department_id%type |
3 | 9 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_manager_id in departments.manager_id%type |
4 | 31 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_department_id in departments.department_id%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Major | G-7160: Always explicitly state parameter mode. | in_first_name employees.first_name%type |
2 | 13 | Major | G-7160: Always explicitly state parameter mode. | in_last_name employees.last_name%type |
3 | 14 | Major | G-7160: Always explicitly state parameter mode. | in_email employees.email%type |
4 | 15 | Major | G-7160: Always explicitly state parameter mode. | in_department_id employees.department_id%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 27 | Minor | G-1040: Avoid dead code. | return |
2 | 27 | Minor | G-7250: Never use RETURN in package initialization block. | return |
3 | 13 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_increase in types_up.sal_increase_type |
4 | 37 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_increase in types_up.sal_increase_type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 15 | Major | G-3180: Always specify column names instead of positional references in ORDER BY clauses. | 4 |
2 | 15 | Major | G-3180: Always specify column names instead of positional references in ORDER BY clauses. | 1 |
3 | 15 | Major | G-3180: Always specify column names instead of positional references in ORDER BY clauses. | 3 |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 38 | Critical | G-3310: Never commit within a cursor loop. | commit |
2 | 32 | Major | G-3210: Always use BULK OPERATIONS (BULK COLLECT, FORALL) whenever you have to execute a DML statement for more than 4 times. | for r_order in ( select o.order_id,o.customer_id from orders o where o.order_status = 'New' ) loop l_discount := sales_api.calculate_discount(p_customer_id => r_order.customer_id); update order_lines ol set ol.discount = l_discount where ol.order_id = r_order.order_id; l_counter := l_counter + 1; if l_counter = 100 then commit; l_counter := 0; end if; end loop new_orders |
3 | 61 | Major | G-3210: Always use BULK OPERATIONS (BULK COLLECT, FORALL) whenever you have to execute a DML statement for more than 4 times. | for r_order in ( select o.order_id,o.customer_id from orders o where o.order_status = 'New' ) loop l_discount := sales_api.calculate_discount(p_customer_id => r_order.customer_id); update order_lines ol set ol.discount = l_discount where ol.order_id = r_order.order_id; end loop new_orders |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 21 | Minor | G-4110: Always use %NOTFOUND instead of NOT %FOUND to check whether a cursor returned data. | not c_employees%found |
2 | 20 | Minor | G-4330: Always use a CURSOR FOR loop to process the complete cursor results unless you are using bulk operations. | fetch c_employees into r_employee |
3 | 42 | Minor | G-4330: Always use a CURSOR FOR loop to process the complete cursor results unless you are using bulk operations. | fetch c_employees into r_employee |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 20 | Major | G-4130: Always close locally opened cursors. | open c_department_salary(p_dept_id => in_dept_id) |
2 | 12 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dept_id in departments.department_id%type |
3 | 30 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dept_id in departments.department_id%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 16 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_employee_found := true |
2 | 31 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_employee_found := c_employees%found |
3 | 14 | Major | G-4385: Never use a cursor for loop to check whether a cursor returns data. | for r_employee in c_employees loop l_employee_found := true; end loop check_employees |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 20 | Major | G-5060: Avoid unhandled exceptions | select department_name into l_department_name from departments where department_id = in_id |
2 | 16 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_id in departments.department_id%type |
3 | 32 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_id in departments.department_id%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 10 | Minor | G-7125: Always use CREATE OR REPLACE instead of CREATE alone. | employee_api |
2 | 11 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
3 | 32 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_employee_id in employees.employee_id%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 25 | Major | G-7230: Avoid declaring global variables public. | g_salary_increase |
2 | 33 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_increase in types_up.sal_increase_type |
3 | 64 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_increase in types_up.sal_increase_type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 21 | Minor | G-3150: Try to use identity columns for surrogate keys. | nextval |
2 | 35 | Minor | G-3150: Try to use identity columns for surrogate keys. | nextval |
3 | 17 | Minor | G-7730: Avoid multiple DML events per trigger. | insert or update on departments |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 18 | Major | G-5060: Avoid unhandled exceptions | select * into r_return from departments where department_name = in_dept_name |
2 | 36 | Major | G-5060: Avoid unhandled exceptions | select * into r_return from departments where department_name = l_dept_name |
3 | 10 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_dept_name in departments.department_name%type |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 8 | Minor | G-1010: Try to label your sub blocks. | begin null; end |
2 | 12 | Minor | G-1010: Try to label your sub blocks. | begin null; end |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 10 | Minor | G-1030: Avoid defining variables that are not used. | l_first_name |
2 | 12 | Minor | G-1030: Avoid defining variables that are not used. | e_good |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Minor | G-1070: Avoid nesting comment blocks. | /* comment one -- nested comment two */ |
2 | 11 | Minor | G-1070: Avoid nesting comment blocks. | -- comment three /* nested comment four */ |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_function_result := maintenance.get_config('parallel_degree') |
2 | 13 | Minor | G-2145: Never self-assign a variable. | l_parallel_degree := l_parallel_degree |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 14 | Minor | G-2220: Try to use PLS_INTEGER instead of NUMBER for arithmetic operations with integer values. | number(5,0) |
2 | 14 | Minor | G-2230: Try to use SIMPLE_INTEGER datatype when appropriate. | number(5,0) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 20 | Minor | G-2220: Try to use PLS_INTEGER instead of NUMBER for arithmetic operations with integer values. | number(5,0) |
2 | 20 | Minor | G-2230: Try to use SIMPLE_INTEGER datatype when appropriate. | number(5,0) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Major | G-2330: Never use zero-length strings to substitute NULL. | := '' |
2 | 9 | Minor | G-2340: Always define your VARCHAR2 variables using CHAR SEMANTIC (if not defined anchored). | varchar2(1) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 17 | Major | G-3140: Try to use anchored records as targets for your cursors. | into l_employee_id,l_first_name,l_last_name |
2 | 22 | Major | G-3140: Try to use anchored records as targets for your cursors. | into l_employee_id,l_first_name,l_last_name |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 23 | Major | G-3145: Avoid using SELECT * directly from a table or view. | * |
2 | 42 | Major | G-3145: Avoid using SELECT * directly from a table or view. | * |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 13 | Major | G-3190: Avoid using NATURAL JOIN. | natural join departments d |
2 | 32 | Major | G-3190: Avoid using NATURAL JOIN. | natural join departments d |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Minor | G-4220: Try to use CASE rather than DECODE. | decode(ctry.country_code, constants_up.co_ctry_uk, constants_up.co_lang_english , constants_up.co_ctry_fr, constants_up.co_lang_french , constants_up.co_ctry_de, constants_up.co_lang_german , constants_up.co_lang_not_supported) |
2 | 18 | Minor | G-4220: Try to use CASE rather than DECODE. | decode(ctry.country_code, constants_up.co_ctry_uk, constants_up.co_lang_english , constants_up.co_ctry_fr, constants_up.co_lang_french , null , constants_up.co_lang_unknown , constants_up.co_lang_not_supported) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 16 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | exit process_employees |
2 | 16 | Minor | G-4375: Always use EXIT WHEN instead of an IF statement to exit from a loop. | exit process_employees |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 29 | Minor | G-4380: Try to label your EXIT WHEN statements. | exit when l_innerlp = co_exit_value |
2 | 32 | Minor | G-4380: Try to label your EXIT WHEN statements. | exit when l_innerlp = co_exit_value |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 16 | Blocker | G-5030: Never assign predefined exception names to user defined exceptions. | no_data_found exception; |
2 | 26 | Critical | G-5070: Avoid using Oracle predefined exceptions | raise no_data_found |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 14 | Major | G-7110: Try to use named notation when calling program units. | r_employee |
2 | 14 | Major | G-7110: Try to use named notation when calling program units. | co_id |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 22 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_wait in integer |
2 | 58 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | in_wait in integer |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Major | G-7710: Avoid cascading triggers. | departments_hist |
2 | 43 | Major | G-7710: Avoid cascading triggers. | departments_hist |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Blocker | G-7720: Never use multiple UPDATE OF in trigger event clause. | update of department_id |
2 | 12 | Minor | G-7730: Avoid multiple DML events per trigger. | update of department_id or update of department_name on departments |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 21 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_sequence_number := employees_seq.nextval |
2 | 11 | Major | G-7810: Never use SQL inside PL/SQL to read sequence numbers (or SYSDATE). | employees_seq.nextval |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 14 | Major | G-8110: Never use SELECT COUNT(*) if you are only interested in the existence of a row. | count(*) |
2 | 19 | Major | G-8120: Never check existence of a row to decide whether to create it or not. | l_count = 0 then insert into departments values in_r_department; |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 18 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | date_in in date |
2 | 50 | Minor | G-8310: Always validate input parameter size by assigning the parameter to a size limited variable in the declaration section of program unit. | date_in in date |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 16 | Minor | G-2140: Never initialize variables with NULL. | l_value pls_integer := null; |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 21 | Major | G-1060: Avoid storing ROWIDs or UROWIDs in database tables. | rowid |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 16 | Minor | G-1080: Avoid using the same expression on both sides of a relational comparison operator or a logical operator. | emp.salary > 3000 or emp.salary > 3000 |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Major | G-2110: Try to use anchored declarations for variables, constants and types. | l_last_name varchar2(20 char); |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Minor | G-2120: Try to have a single location to define your types. | subtype big_string_type is varchar2(1000 char); |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 19 | Major | G-2135: Avoid assigning values to local variables that are not used by a subsequent statement. | l_message := 'Hello, ' || l_last_name |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 8 | Minor | G-2140: Never initialize variables with NULL. | l_note big_string_type := null; |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Blocker | G-2150: Avoid comparisons with NULL value, consider using IS [NOT] NULL. | l_value = null |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Critical | G-2160: Avoid initializing variables using functions in the declaration section. | l_department_name departments.department_name%type := department_api.name_by_id(in_id => co_department_id); |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 17 | Major | G-2170: Never overload variables. | l_variable |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 18 | Major | G-2190: Avoid using ROWID or UROWID. | rowid |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 10 | Minor | G-2210: Avoid declaring NUMBER variables, constants or subtypes with no precision. | number |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Major | G-2310: Avoid using CHAR data type. | char(200) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Major | G-2320: Never use VARCHAR data type. | varchar(200) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Minor | G-2340: Always define your VARCHAR2 variables using CHAR SEMANTIC (if not defined anchored). | varchar2(200) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 10 | Minor | G-2610: Never use self-defined weak ref cursor types. | type local_weak_cursor_type is ref cursor; |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 8 | Major | G-3110: Always specify the target columns when coding an insert statement. | insert into departments values ( departments_seq.nextval ,'Support' ,100 ,10) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Minor | G-3115: Avoid self-assigning a column. | first_name = first_name |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Minor | G-3130: Try to use ANSI SQL-92 join syntax. | employees e ,departments d |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 19 | Major | G-3145: Avoid using SELECT * directly from a table or view. | * |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 26 | Minor | G-3150: Try to use identity columns for surrogate keys. | nextval |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 17 | Major | G-3185: Never use ROWNUM at the same query level as ORDER BY. | rownum |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 15 | Minor | G-3195: Always use wildcards in a LIKE clause. | e.last_name like 'Smith' |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 22 | Major | G-3210: Always use BULK OPERATIONS (BULK COLLECT, FORALL) whenever you have to execute a DML statement for more than 4 times. | for i in 1..t_employee_ids.count() loop update employees set salary = salary + (salary * co_increase) where employee_id = t_employee_ids(i); end loop process_employees |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 22 | Major | G-3220: Always process saved exceptions from a FORALL statement. | forall i in 1..t_employee_ids.count() save exceptions update employees set salary = salary + (salary * co_increase) where employee_id = t_employee_ids(i) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 26 | Critical | G-4120: Avoid using %NOTFOUND directly after the FETCH when working with BULK OPERATIONS and LIMIT clause. | c_employees%notfound |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 10 | Major | G-4210: Try to use CASE rather than an IF statement with multiple ELSIF paths. | if l_color = constants_up.co_red then my_package.do_red(); elsif l_color = constants_up.co_blue then my_package.do_blue(); elsif l_color = constants_up.co_black then my_package.do_black(); end if |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 10 | Critical | G-4230: Always use a COALESCE instead of a NVL command, if parameter 2 of the NVL function is a function call or a SELECT statement. | nvl(dummy,my_package.expensive_null(value_in => dummy)) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Critical | G-4240: Always use a CASE instead of a NVL2 command if parameter 2 or 3 of NVL2 is either a function call or a SELECT statement. | nvl2(dummy,my_package.expensive_nn(value_in => dummy) ,my_package.expensive_null(value_in => dummy)) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 18 | Major | G-4250: Avoid using identical conditions in different branches of the same IF or CASE statement. | constants_up.co_red |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Minor | G-4260: Avoid inverting boolean conditions with NOT. | not l_color |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 13 | Minor | G-4270: Avoid comparing boolean values to boolean literals. | l_is_valid = true |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 14 | Major | G-4325: Never reuse labels in inner scopes. | <<my_label>> |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 21 | Minor | G-4330: Always use a CURSOR FOR loop to process the complete cursor results unless you are using bulk operations. | fetch c_employees into r_employee |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 27 | Minor | G-4340: Always use a NUMERIC FOR loop to process a dense array. | i > t_employees.count() |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 18 | Major | G-4350: Always use 1 as lower and COUNT() as upper bound when looping through a dense array. | t_employees.first()..t_employees.last() |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 28 | Minor | G-4360: Always use a WHILE loop to process a loose array. | 1..t_employees.count() |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 13 | Major | G-4365: Never use unconditional CONTINUE or EXIT in a loop. | continue process_employees |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 23 | Major | G-4390: Avoid use of unreferenced FOR loop indexes. | for i in co_lower_bound..co_upper_bound loop sys.dbms_output.put_line(l_row || co_delimiter || l_value); l_row := l_row + co_row_incr; l_value := l_value + co_value_incr; end loop for_loop |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Minor | G-4395: Avoid hard-coded upper or lower bound values with FOR loops. | 1..5 |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 18 | Critical | G-5020: Never handle unnamed exceptions using the error number. | when others then if sqlcode = co_no_data_found then null; end if; |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 21 | Major | G-5040: Avoid use of WHEN OTHERS clause in an exception section without any other specific handlers. | when others then my_package.some_further_processing(); |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 18 | Major | G-5050: Avoid use of the RAISE_APPLICATION_ERROR built-in procedure with a hard-coded 20nnn error number or hard-coded message. | raise_application_error(-20501,'Invalid employee_id') |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 16 | Critical | G-5070: Avoid using Oracle predefined exceptions | raise no_data_found |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Major | G-6010: Always use a character variable to execute dynamic SQL. | execute immediate 'select employees_seq.nextval from dual' into l_next_val |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 19 | Major | G-7140: Always ensure that locally defined procedures or functions are referenced. | function my_func return number |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Minor | G-7210: Try to keep your packages small. Include only few procedures and functions that are used in the same context. | example_pkg |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Minor | G-7310: Avoid standalone procedures – put your procedures in packages. | my_procedure |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 20 | Major | G-7320: Avoid using RETURN statements in a PROCEDURE. | return |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Minor | G-7410: Avoid standalone functions – put your functions in packages. | my_function |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 9 | Major | G-7440: Never use OUT parameters to return values from a function. | out_date out date |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 11 | Major | G-7450: Never return a NULL value from a BOOLEAN function. | return null |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Major | G-7510: Always prefix Oracle supplied packages with owner schema name. | dbms_output.put_line(co_hello_world) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 17 | Minor | G-7730: Avoid multiple DML events per trigger. | insert or update on departments |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 15 | Major | G-8110: Never use SELECT COUNT(*) if you are only interested in the existence of a row. | count(*) |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 19 | Major | G-8210: Always use synonyms when accessing objects of another application schema. | oe.products |
Issue# | Line | Severity | Message | Code Excerpt |
---|---|---|---|---|
1 | 12 | Major | G-4385: Never use a cursor for loop to check whether a cursor returns data. | for emp_rec in ( select employee_id from employees order by employee_id ) loop null; -- some processing end loop employees |