@@ -3544,6 +3544,161 @@ RETURN *
35443544======
35453545=====
35463546
3547+ [#_neo_clientnotification_statement_redundantoptionalprocedure]
3548+ === Redundant optional procedure
3549+
3550+ .Notification details
3551+ [cols="<1s,<4"]
3552+ |===
3553+ |Neo4j code
3554+ m|Neo.ClientNotification.Statement.RedundantOptionalProcedure
3555+ |Title
3556+ a|The use of `OPTIONAL` is redundant when the procedure calls a void procedure.
3557+ |Description
3558+ |The use of `OPTIONAL` is redundant as `CALL %s` is a void procedure.
3559+ |Category
3560+ m|GENERIC
3561+ |GQLSTATUS code
3562+ m|03N61
3563+ |Status description
3564+ a|info: redundant optional procedure. The use of `OPTIONAL` is redundant as `CALL %s` is a void procedure.
3565+ |Classification
3566+ m|GENERIC
3567+ |SeverityLevel
3568+ m|INFORMATION
3569+ |===
3570+
3571+ .Redundant use of `OPTIONAL` in a procedure call
3572+ [.tabbed-example]
3573+ =====
3574+ [.include-with-neo4j-code]
3575+ ======
3576+ Query::
3577+ +
3578+ [source,cypher]
3579+ ----
3580+ OPTIONAL CALL db.createLabel("A")
3581+ ----
3582+
3583+ Description of the returned code::
3584+ The use of `OPTIONAL` is redundant as `CALL db.createLabel` is a void procedure.
3585+
3586+ Suggestions for improvement::
3587+ If the intended behavior of the query is to use a void procedure, the `OPTIONAL` keyword can be removed without impacting the query.
3588+ +
3589+ [source,cypher]
3590+ ----
3591+ CALL db.createLabel("A")
3592+ ----
3593+ ======
3594+ [.include-with-GQLSTATUS-code]
3595+ ======
3596+ Query::
3597+ +
3598+ [source,cypher]
3599+ ----
3600+ OPTIONAL CALL db.createLabel("A")
3601+ ----
3602+ Returned GQLSTATUS code::
3603+ 03N61
3604+
3605+ Returned status description::
3606+ info: redundant optional procedure. The use of `OPTIONAL` is redundant as `CALL db.createLabel` is a void procedure.
3607+
3608+ Suggestions for improvement::
3609+ If the intended behavior of the query is to use a void procedure, the `OPTIONAL` keyword can be removed without impacting the query.
3610+ +
3611+ [source,cypher]
3612+ ----
3613+ CALL db.createLabel("A")
3614+ ----
3615+ ======
3616+ =====
3617+
3618+ [#_neo_clientnotification_statement_redundantoptionalsubquery]
3619+ === Redundant optional subquery
3620+
3621+ .Notification details
3622+ [cols="<1s,<4"]
3623+ |===
3624+ |Neo4j code
3625+ m|Neo.ClientNotification.Statement.RedundantOptionalSubquery
3626+ |Title
3627+ a|The use of `OPTIONAL` is redundant when `CALL` is a unit subquery.
3628+ |Description
3629+ |The use of `OPTIONAL` is redundant as `CALL` is a unit subquery.
3630+ |Category
3631+ m|GENERIC
3632+ |GQLSTATUS code
3633+ m|03N62
3634+ |Status description
3635+ a|info: redundant optional subquery. The use of `OPTIONAL` is redundant as `CALL` is a unit subquery.
3636+ |Classification
3637+ m|GENERIC
3638+ |SeverityLevel
3639+ m|INFORMATION
3640+ |===
3641+
3642+ .Redundant use of `OPTIONAL` in a `CALL` subquery
3643+ [.tabbed-example]
3644+ =====
3645+ [.include-with-neo4j-code]
3646+ ======
3647+ Query::
3648+ +
3649+ [source,cypher]
3650+ ----
3651+ UNWIND [1, 2, 3] AS x
3652+ OPTIONAL CALL (x) {
3653+ CREATE({i:x})
3654+ }
3655+ ----
3656+
3657+ Description of the returned code::
3658+ Optional is redundant in the case of a unit subquery. The use of `OPTIONAL` on unit subqueries have no effect and can be removed.
3659+
3660+ Suggestions for improvement::
3661+ If the intended behavior of the query is for the subquery not to return any values, the `OPTIONAL` keyword can be removed without impacting the query.
3662+ +
3663+ [source,cypher]
3664+ ----
3665+ UNWIND [1, 2, 3] AS x
3666+ CALL (x) {
3667+ CREATE({i:x})
3668+ }
3669+ ----
3670+ ======
3671+ [.include-with-GQLSTATUS-code]
3672+ ======
3673+ Query::
3674+ +
3675+ [source,cypher]
3676+ ----
3677+ UNWIND [1, 2, 3] AS x
3678+ OPTIONAL CALL (x) {
3679+ CREATE({i:x})
3680+ }
3681+ ----
3682+
3683+ Returned GQLSTATUS code::
3684+ 03N62
3685+
3686+ Description of the returned code::
3687+ info: redundant optional subquery. The use of `OPTIONAL` is redundant as `CALL` is a unit subquery.
3688+
3689+ Suggestions for improvement::
3690+ If the intended behavior of the query is for the subquery not to return any values, the `OPTIONAL` keyword can be removed without impacting the query.
3691+ +
3692+ [source,cypher]
3693+ ----
3694+ UNWIND [1, 2, 3] AS x
3695+ CALL (x) {
3696+ CREATE({i:x})
3697+ }
3698+ ----
3699+ ======
3700+ =====
3701+
35473702[#_neo_clientnotification_statement_parameternotprovided]
35483703=== Parameter missing
35493704
0 commit comments