Skip to content

Analyzer: Determine number of statements #94

@KieranKaelin

Description

@KieranKaelin

Goal

Given a function, procedure or trigger, the analyzer should determine the number of statements.

Notes

  • Nested statements should also be counted
  • Expressions in the control flow should also be counted as their own statements (since they may pose a significant migration effort)

Example

CREATE PROCEDURE showcase
    IS
DECLARE
    formatted_output VARCHAR2(100);
BEGIN
    SELECT 'name: ' || dummy || ', last login: '  INTO formatted_output FROM DUAL;

    IF (formatted_output != '') THEN
        DBMS_OUTPUT.PUT_LINE(formatted_output);
    ELSIF TRUE != FALSE THEN
        NULL;
    ELSE
        NULL;
    END IF;
END;

Number of statements: 6

  • 1 for the first SELECT INTO
  • 2 for the expressions in the IF construct ((formatted_output != "") and TRUE != FALSE)
  • 3 for all nested statements inside the IF branches

How to demo

Rust and TS tests demonstrate the new analyzer statistics.

Metadata

Metadata

Assignees

No one assigned

    Labels

    analyzerAnalyzing of PL/SQL codeenhancementNew feature or requestwasmWASM interface changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions