Skip to content

Release 4.3.0

Latest

Choose a tag to compare

@github-actions github-actions released this 21 Nov 00:18
364694f

Read the ZPA 4.3.0 release post for the highlights and what to check before upgrading: the new database metadata support, conditional compilation, eight new rules active by default, and changes for custom rule developers.

SonarQube compatibility

This release supports SonarQube Community Build 26.7 and newer and has been tested with versions 26.7 through 26.11.

SonarQube commercial builds are not supported. If you need to analyze projects without installing a SonarQube plugin, consider using zpa-cli.

Install or update

  1. Download sonar-zpa-plugin-4.3.0.jar.
  2. Copy it to SONARQUBE_HOME/extensions/plugins, replacing the previous ZPA version.
  3. Restart SonarQube.

What's changed

🚀 Features

api

  • resolve schema types written in a package in the public snapshot, as the analysis does

checks

  • follow dynamic SQL text variables through IN arguments
  • add rule "Parameters should not be concatenated into dynamic SQL"
  • add rule "Columns should not be read into variables smaller than the column"
  • add rule "Character columns should not be compared with numbers or dates"
  • add rule "NOT IN should not be used with values that may be null"
  • add rule "Columns should not shadow parameters or variables in SQL conditions"
  • add rule "Conditions should not discard the rows an outer join adds"
  • add rule "Functions should not reach their end without returning a value"
  • add rule "IS NULL conditions should not test columns that can never be null"
  • report InsertWithoutColumns for a record of a query with its own select list

dev/oracle

  • add PowerShell wrapper oracle-probe.ps1

grammar

  • accept system triggers with several events, ANALYZE COMPUTE/ESTIMATE STATISTICS and reserved words as bind names

lexer

  • expose the rule of an unquoted identifier
  • evaluate conditional compilation conditions from configured flags and database version (#446)
  • report conditional compilation text as trivia (#446)

metadata

  • preserve Oracle column nullability in external columns

oracle

  • read public synonyms by default in the Sonar plugin's metadata acquisition
  • let the caller assert that the session sees a whole schema
  • read the target database version from the database for conditional compilation (#446)
  • integrate database metadata into SonarQube analysis (#445)
  • add optional database metadata acquisition module (#445)

parser

  • parse the SQL text built by dynamic statements (#260)

plugin

  • split rule descriptions into why and how-to-fix sections
  • highlight number, date and timestamp literals as constants
  • resolve issues from sonar-resolve comments in PL/SQL code
  • declare a category on each rule and send it to SonarQube as the clean code attribute

project

  • categorize a value anchored to a column's %TYPE by the column's type
  • reject records, rows and collections passed for another composite type
  • read subprogram signatures from the dictionary and type the result of their calls
  • type LENGTHB, CARDINALITY, EMPTY_BLOB and EMPTY_CLOB actuals
  • read object types from the dictionary and use them in call resolution
  • keep a source table complete after ADD CONSTRAINT and bind the columns an incomplete table lists
  • add a public lookup of the synonyms created in the sources
  • add a public lookup of relations and columns that includes the tables of the sources
  • read the columns of the CREATE TABLE statements of the sources beside the metadata
  • type the actuals that are calls of STANDARD functions, operators, CAST and CASE
  • read the CREATE SYNONYM statements of the sources like the metadata synonyms
  • read a written json as the schema's json type or synonym below Oracle 21
  • choose overloads by the project's object type hierarchy and type NEW and JSON constructor actuals
  • bind package cursors and keep the names of their select lists
  • follow synonyms to the targets of calls, package values and types
  • read schema object names and synonyms to decide schema-qualified and synonym anchors
  • exclude body-level captures, follow %TYPE through package record fields and choose composite overloads by declared type
  • rank overloads by the dictionary type of column-anchored formals and actuals
  • decide member names that a specification's conditional text does not write
  • bind an overloaded call to the candidate Oracle prefers
  • expose the schema preference and the omitted callables on the snapshot and read supertype fields from the subtype's schema (#453)
  • look up supertypes from the schema of the type that names them and share the index between schema views (#453)
  • pair bodies with specifications by schema and prefer the unit's own schema (#453)
  • resolve schema-qualified names through the schema each file compiles in (#453)
  • list the attributes of a standalone type
  • resolve collection methods as members of collection types (#440)
  • index object type method signatures and resolve method members to their overload set (#449)
  • index object type attributes and resolve members through them (#449)
  • say whether an external relation is a view, and read the row type of object views
  • index package exceptions and cursors as declarations
  • expose external metadata to analysis checks
  • narrow overloads using datatype compatibility (#427)
  • add conservative datatype compatibility matrix (#427)
  • compose source and external type descriptions (#426)
  • track package member name coverage (#426)
  • add immutable external schema metadata (#426)
  • support caller-written type anchors (#426)
  • expose structural call resolution API (#425)
  • expose public call candidate discovery API (#425)
  • add structural call discovery and argument binding (#425)
  • track incomplete package callable extraction (#425)
  • resolve source-backed type anchors (#424)
  • add classified package value resolution (#424)
  • add bounded type descriptions (#423)
  • expose collection element types in public views (#423)
  • retain standalone collection element types (#423)
  • retain package collection element types (#423)
  • expose typed package value views (#422)
  • extract package specification values (#422)
  • model package variables and constants (#422)
  • expose typed standalone subprogram views (#421)
  • extract standalone function declarations (#421)
  • extract standalone procedure declarations (#421)
  • add standalone subprogram facts to project index (#421)
  • expose project snapshots during analysis (#420)
  • expose package specification correlation (#420)
  • expose package subprogram inventory (#420)
  • expose named type resolution API (#420)
  • expose immutable package subprogram signatures (#420)
  • expose immutable type declaration views (#420)
  • expose immutable declaration inventory (#420)
  • expose public project snapshot preparation API (#420)

semantics

  • describe the declared type of a source datatype with its written constraints

symbols

  • highlight FOR UPDATE OF qualifiers and WITH query names as symbols
  • highlight table aliases and table names of SQL statements as symbols
  • bind functions named without parentheses in SQL and calls inside parsed dynamic SQL texts
  • type column actuals of calls written in SQL and read integer literals there as NUMBER
  • type a query row's field and SUBSTR's result in call actuals
  • answer column bindings inside parsed dynamic SQL texts and list known outer matches as candidates
  • list the candidate columns of an undecided column binding and answer outer-join and bind variable names
  • tell which column a name of static SQL reads
  • type Oracle Forms host variables from the data types in the Forms metadata
  • bind cursor FOR loops, specification types and calls inside SQL from another file's specification
  • constrain MethodMatcher arguments with predicates
  • add callBinding to tell what the local analysis decided for each call
  • narrow object method calls with several applicable overloads by their actuals' datatypes
  • type elements of call results, signed numbers and cursor attributes in call actuals
  • type method results, constructor results and same-return overloaded calls in call actuals
  • type elements, conditions, built-ins without parentheses, TREAT and concatenation in call actuals
  • type ref cursor variables, schema object values, member paths and collection COUNT in call actuals
  • read a declaration in a kept branch as unused when nothing in the branch can shadow it (#446)
  • count undecided conditional text only for the names it mentions (#446)
  • resolve type names at SQL, index-by key and ref cursor return positions (#444)
  • resolve written type names and constructor results in the local type walk (#444)
  • categorize members after an element or a call result in value categories (#444)
  • follow member chains through project record and object types in value categories (#444)
  • bind a local value written with an argument list inside static SQL
  • answer fieldBinding after an element of a local collection and tell which type a datatype name binds
  • answer fieldBinding for an attribute named without self in a type body
  • add fieldBinding to tell which record field or object attribute a segment names
  • drop the uncertainty of a $IF the configured settings decide
  • answer nameBinding on each segment of a qualified name
  • show the local resolution in the toolkit's symbol table tab (#442)
  • highlight symbols in SonarQube from the local resolution (#442)
  • build highlighting pairs from the local resolution (#442)
  • record segment ranges and member positions in the local model (#442)
  • move FunctionShouldBeDeterministicCheck to the local resolution (#441)
  • move SelectAllColumnsCheck to the value category and name binding (#441)
  • add value category API and move InsertWithoutColumnsCheck to it (#441)
  • move ColumnsShouldHaveTableNameCheck and VariableInCountCheck to the name binding (#441)
  • add name binding API and move DeterministicFunctionCheck to it (#441)
  • add exception binding API and move UnhandledUserDefinedExceptionCheck to it (#441)
  • add hiding evidence API and move VariableHidingCheck to it (#441)
  • move UnusedCursorCheck to the usage evidence (#441)
  • move UnusedParameterCheck to the usage evidence (#441)
  • add usage evidence API and move UnusedVariableCheck to it (#441)
  • resolve members after collection elements and call results (#451)
  • decide names a package body shares with its specification in another file (#450)
  • use an attribute named alone as the member base in a type body (#440)
  • decide names in an object type body from the project's member lists (#440)
  • bind object method and constructor calls through the project index (#449)
  • resolve an object type's own name inside its body and specification (#440)
  • resolve SELF members through the enclosing object type (#440)
  • turn the local type-name gate on by default (#440)
  • decide the project type-name gate from the local resolution behind an internal switch (#440)
  • decide package body lookups with the project's specification coverage (#440)
  • run the local semantic resolution in the pipeline in shadow mode (#440)
  • bind and narrow method calls inside object type bodies (#439)
  • derive call evidence from function results, elements and loop indexes (#438)
  • derive call evidence from function results, elements and loop indexes (#438)
  • supply local datatype evidence to project call resolution (#438)
  • check the local resolver against legacy usages and Oracle cases, and index its lookups (#437)
  • resolve object type members and SQL qualified names in the local model (#437)
  • resolve qualified names and label targets in the local model (#437)
  • resolve plain names and first segments in the local model (#437)
  • add per-region completeness evidence to the local model (#436)
  • model packages, triggers and object types in the local model (#435)
  • extract subprograms, loops, labels and cursors into the local model (#435)
  • add AST-detached local region and declaration model (#435)

testkit

  • verify checks through the scanner, with settings and an unprepared run (#442)

toolkit

  • adapt window size to screen resolution using scaled dimensions
  • add project sources selection and improve project overview handling
  • add project overview rendering and selection handling

🐛 Fixes

checks

  • avoid parent access errors in NotInWithNullCheck
  • accept only selected expressions and expressions built from them in NotASelectedExpression
  • check standalone SQL statements in SequenceNextvalInConditionalResult
  • check queries with ANSI joins in ColumnsShouldHaveTableName
  • leave a path that ends in an unseen call unreported in FunctionWithoutReturn
  • handle EXIT statements with unknown labels
  • correct typos in pt-BR rule docs
  • correct typos in rule messages and docs

grammar

  • accept DATE and TIMESTAMP literals with any string
  • reject privileges glued to ON COMMIT REFRESH in GRANT and IF NOT EXISTS on private temporary tables
  • parse the type of TREAT and IS OF as a datatype
  • accept KEEP before MODEL cell references and align MODEL clause with Oracle

lexer

  • ignore a leading byte-order mark
  • handle nested and quoted conditional compilation directives (#446)

oracle

  • support Oracle 11.2 dictionaries in metadata acquisition (#445)

project

  • read a type written a.t as schema a only when no object takes a
  • answer a method after a column as the column and give a RETURN cursor's loop record its row
  • read Oracle metadata names as Oracle identifiers
  • fix project schema paths for rooted file identities
  • extract call specification functions of a package specification
  • read a schema-qualified name through its schema before its written spelling (#453)
  • resolve unqualified calls to units written with the unit's own schema (#453)
  • extract polymorphic table functions, ACCESSIBLE BY methods and units after a package body without semicolon (#452)
  • resolve schema types used inside a package when the package does not declare the name
  • end a CREATE TYPE or CREATE SEQUENCE without ';' at its '/' line
  • retain declarations typed by an anchor behind a database link
  • accept END LOOP as the end label of a block
  • correct external metadata contracts
  • preserve namespace evidence for omitted standalone callables (#425)
  • preserve character set datatypes and incomplete callable coverage (#425)
  • respect incomplete callable coverage in procedure resolution (#425)
  • align identifier identity with Oracle semantics
  • prevent unsound type anchors in package bodies (#424)
  • correct subtype base datatype ranges (#423)
  • harden package specification extraction boundaries (#422)
  • tighten public JVM API boundaries (#420)

symbols

  • bind a cursor the specification declares with RETURN only to its definition in the body
  • rule out an overload whose argument needs a BOOLEAN conversion when another needs none
  • bind functions named without parentheses in the VALUES of a single-table INSERT
  • stop answering the member after a collection element or call result as a column
  • leave a qualified name undecided when its source's columns are unknown and another name may take it
  • treat a dynamic SQL text whose holes write only values as complete
  • decide SQL calls of a package body’s own declarations when its specification is in another file
  • leave a SQL name undecided when conditional text in its statement may write its alias (#446)
  • read an anonymous block's names in its file's schema and find a type body's specification by schema (#453)
  • bind members after an element in SQL and limit conditional text to the lookups it can change (#444)
  • categorize parameter types of specification headings (#444)
  • answer fieldBinding when the package spec is in another file, never more certain than the chain start
  • keep the uncertainty of a $IF inside the unit it is in
  • reject a method selected across the instance boundary inside a type body (#439)
  • link incomplete object types and reduce local model memory (#435)

🔄️ Changes

checks

  • test for a star column before searching the file's FETCH statements in SelectAllColumnsCheck (#441)

grammar

  • enable memo retention to avoid exponential parsing of nested calls
  • prevent exponential parsing of malformed parentheses
  • avoid redundant vector expression lookaheads

lexer

  • share equal token strings within a file

project

  • make source-backed type traversal linear (#424)
  • index declarations by qualified name (#424)

scanner

  • compute highlighting pairs only for scanners that ask for them
  • resolve each file's local names before taking the rule lock and index LocalHiding's name nodes once (#440)
  • take the scanner lock only when a rule check applies to the file

symbols

  • avoid repeated whole-file scans in the local semantic pass
  • count line lengths in one pass and walk visitors by index
  • walk children by index without allocating iterators
  • compact the local analysis kept per file
  • keep the file's local analysis and subprogram declarations on the root node
  • cut the local pre-pass cost of describing external types (#444)

ZPA Toolkit

Download zpa-toolkit-4.3.0.jar to inspect the parser AST and symbol table.

The toolkit requires Java 21 or newer.

Developing custom ZPA plugins?

Binary compatibility is not guaranteed between ZPA versions. Custom plugins should be recompiled against the same version of sonar-zpa-plugin used by the SonarQube instance.