Riverside-Software / sonar-openedge

CABL (Code Analyzer for ABL in SonarQube) - ABL ANTLR4 Parser
https://riverside-software.fr
GNU Lesser General Public License v3.0
63 stars 25 forks source link

Unused variable false positive when using select statement #851

Closed cverbiest closed 3 years ago

cverbiest commented 3 years ago

I created following sample when trying to reproduce a parse error on the select statement. I do not get the parse error but I get false positives on llist & lCountr.

If I remove the select statement the false positives are gone as well.

define variable lList as character no-undo.
define variable lCountr as integer no-undo.
lLIST = "a".
assign substring(lLIST,1,1) = "".
select count(*) into lCountr from _user.
if lList > "" and lCountr > 0
then display lCountr lList.
Trigger: EDITOR_CHANGE
Clear markers on 0 excluded files
SonarLint processing file /CceSmartTools/src/cceinc/select_count.p...
Language on L/CceSmartTools/src/cceinc/select_count.p
Entering canConfigure...
useXrefXML: false
sonar.sources set to 'C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\src'
sonar.oe.propath set to 'C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\cfg,C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\src,C:\Users\cvb\git\develop\ccesmarttools\SmartToolsCommon\src,C:\Users\cvb\git\develop\ccesmarttools\SmartToolsBackend\src,C:\Users\cvb\git\develop\ccesmarttools\SmartToolsFrontend\src,C:\Users\cvb\git\develop\smartcomponentlibrary\src,C:\Users\cvb\git\develop\smartcomponentlibrary,C:\Users\cvb\git\develop\smartlisa\appl\src,C:\Users\cvb\git\develop\smartlisafin\FinLegacy\src,C:\Progress\oe122\gui\,C:\Progress\oe122\gui\adecomm.pl,C:\Progress\oe122\gui\adecomp.pl,C:\Progress\oe122\gui\adedict.pl,C:\Progress\oe122\gui\adeedit.pl,C:\Progress\oe122\gui\adeicon.pl,C:\Progress\oe122\gui\adeshar.pl,C:\Progress\oe122\gui\adeuib.pl,C:\Progress\oe122\gui\adeweb.pl,C:\Progress\oe122\gui\adexml.pl,C:\Progress\oe122\gui\dataadmin.pl,C:\Progress\oe122\gui\prodict.pl,C:\Progress\oe122\gui\protools.pl,C:\Progress\oe122\gui\OpenEdge.Core.pl,C:\Progress\oe122\gui\OpenEdge.BusinessLogic.pl,C:\Progress\oe122\gui\netlib\OpenEdge.Net.pl,C:\Progress\oe122\src,C:\Progress\oe122,C:\Progress\oe122\bin,C:\Progress\oe122\tty,C:\cce\common,C:\Users\cvb\git\develop\smartlisafin\SmartFinCommon\src'
Number of DB references for project: '7' - '7'
DB schema file already present for: AUTH
DB schema file already present for: CCEREFACT
DB schema file already present for: DEVINFO
DB schema file already present for: LISA
DB schema file already present for: LISADMS
DB schema file already present for: LISALRAP
DB schema file already present for: SmartDB
DB schema task completed
Connected mode (using configuration of 'CCE_Nightly:CceSmartTools' in server 'cce-dev01')
Starting analysis with configuration:
[
  projectKey: CCE_Nightly:CceSmartTools
  baseDir: C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools
  extraProperties: {sonar.oe.propath=C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\cfg,C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\src,C:\Users\cvb\git\develop\ccesmarttools\SmartToolsCommon\src,C:\Users\cvb\git\develop\ccesmarttools\SmartToolsBackend\src,C:\Users\cvb\git\develop\ccesmarttools\SmartToolsFrontend\src,C:\Users\cvb\git\develop\smartcomponentlibrary\src,C:\Users\cvb\git\develop\smartcomponentlibrary,C:\Users\cvb\git\develop\smartlisa\appl\src,C:\Users\cvb\git\develop\smartlisafin\FinLegacy\src,C:\Progress\oe122\gui\,C:\Progress\oe122\gui\adecomm.pl,C:\Progress\oe122\gui\adecomp.pl,C:\Progress\oe122\gui\adedict.pl,C:\Progress\oe122\gui\adeedit.pl,C:\Progress\oe122\gui\adeicon.pl,C:\Progress\oe122\gui\adeshar.pl,C:\Progress\oe122\gui\adeuib.pl,C:\Progress\oe122\gui\adeweb.pl,C:\Progress\oe122\gui\adexml.pl,C:\Progress\oe122\gui\dataadmin.pl,C:\Progress\oe122\gui\prodict.pl,C:\Progress\oe122\gui\protools.pl,C:\Progress\oe122\gui\OpenEdge.Core.pl,C:\Progress\oe122\gui\OpenEdge.BusinessLogic.pl,C:\Progress\oe122\gui\netlib\OpenEdge.Net.pl,C:\Progress\oe122\src,C:\Progress\oe122,C:\Progress\oe122\bin,C:\Progress\oe122\tty,C:\cce\common,C:\Users\cvb\git\develop\smartlisafin\SmartFinCommon\src, sonar.oe.databases=../../ccesmarttools/dump/AUTH.df,../../ccesmarttools/dump/CCEREFACT.df,../../ccesmarttools/dump/DEVINFO.df,../../ccesmarttools/dump/LISA.df,../../ccesmarttools/dump/LISADMS.df,../../ccesmarttools/dump/LISALRAP.df,../../ccesmarttools/dump/MQDB.df, sonar.oe.propath.dlc=true, sonar.sources=src, sonar.oe.aliases=LISA,fromdb,todb,S_LISA, sonar.oe.lint.databases=C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\.sonarlint\AUTH.schema,C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\.sonarlint\CCEREFACT.schema,C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\.sonarlint\DEVINFO.schema,C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\.sonarlint\LISA.schema,C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\.sonarlint\LISADMS.schema,C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\.sonarlint\LISALRAP.schema,C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\.sonarlint\SmartDB.schema}
  inputFiles: [
    file:/C:/Users/cvb/git/develop/ccesmarttools/CceSmartTools/src/cceinc/select_count.p (UTF-8) [oe]
  ]
]

Available languages:
  * Python => "py"
  * Kotlin => "kotlin"
  * JavaScript => "js"
  * Ruby => "ruby"
  * Scala => "scala"
  * Java => "java"
  * OpenEdge => "oe"
  * OpenEdgeDB => "oedb"
  * HTML => "web"
  * JSP => "jsp"
  * XML => "xml"
  * PHP => "php"
Start analysis
Declared extensions of language Python were converted to py: **/*.py
Declared extensions of language Kotlin were converted to kotlin: **/*.kt
Declared extensions of language JavaScript were converted to js: **/*.js,**/*.jsx,**/*.vue
Declared extensions of language Ruby were converted to ruby: **/*.rb
Declared extensions of language Scala were converted to scala: **/*.scala
Declared extensions of language Java were converted to java: **/*.java,**/*.jav
Declared extensions of language OpenEdge were converted to oe: **/*.p,**/*.w,**/*.i,**/*.cls
Declared extensions of language OpenEdgeDB were converted to oedb: **/*.df
Declared extensions of language HTML were converted to web: **/*.html,**/*.xhtml,**/*.cshtml,**/*.vbhtml,**/*.aspx,**/*.ascx,**/*.rhtml,**/*.erb,**/*.shtm,**/*.shtml
Declared extensions of language JSP were converted to jsp: **/*.jsp,**/*.jspf,**/*.jspx
Declared extensions of language XML were converted to xml: **/*.xml,**/*.xsd,**/*.xsl
Declared extensions of language PHP were converted to php: **/*.php,**/*.php3,**/*.php4,**/*.php5,**/*.phtml,**/*.inc
Index files
Language of file 'file:/C:/Users/cvb/git/develop/ccesmarttools/CceSmartTools/src/cceinc/select_count.p' is set to 'oe'
1 file indexed
Quality profiles:
  * java: 'Sonar way' (351 rules)
  * js: 'Sonar way Recommended' (128 rules)
  * jsp: 'Sonar way' (0 rules)
  * kotlin: 'Sonar way' (30 rules)
  * oe: 'CceSmartTools' (84 rules)
  * oedb: 'Sonar way' (1 rules)
  * php: 'Sonar way' (87 rules)
  * py: 'Sonar way' (31 rules)
  * ruby: 'Sonar way' (29 rules)
  * scala: 'Sonar way' (28 rules)
  * web: 'Sonar way' (18 rules)
  * xml: 'Sonar way' (4 rules)
Registering CheckRegistrar class org.sonar.plugins.openedge.RiversideChecksRegistration
Registering CheckRegistrar class org.sonar.plugins.openedge.foundation.BasicChecksRegistration
Registering CheckRegistrar class org.sonar.plugins.openedge.ConsultingwerkChecksRegistration
Registering CheckRegistrar class org.sonar.plugins.openedge.CablSecurityRulesDefinition
...
'JavaSquidSensor' skipped because there is no related file in current project
'Python Squid Sensor' skipped because there is no related file in current project
'Kotlin Sensor' skipped because there is no related file in current project
'SonarJS' skipped because there is no related file in current project
'ESLint-based SonarJS' skipped because there is no related file in current project
'Ruby Sensor' skipped because there is no related file in current project
'Scala Sensor' skipped because there is no related file in current project
Execute Sensor: JavaXmlSensor
Execute Sensor: OpenEdgeSensor
'OpenEdgeDBSensor' skipped because there is no related file in current project
Execute Sensor: OpenEdgeWarningsSensor
Execute Sensor: OpenEdgeProparseSensor
OpenEdge plugin version: 2.9.0-514081a
Loading OpenEdge settings for server ID ''
Adding source directory 'src' ...
  ... resolved to 'C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\src'
No sonar.oe.binaries property, defaults to source directories
No sonar.oe.dotpct property, defaults to <binaries>/.pct directories
Using PROPATH : C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\cfg,C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\src,C:\Users\cvb\git\develop\ccesmarttools\SmartToolsCommon\src,C:\Users\cvb\git\develop\ccesmarttools\SmartToolsBackend\src,C:\Users\cvb\git\develop\ccesmarttools\SmartToolsFrontend\src,C:\Users\cvb\git\develop\smartcomponentlibrary\src,C:\Users\cvb\git\develop\smartcomponentlibrary,C:\Users\cvb\git\develop\smartlisa\appl\src,C:\Users\cvb\git\develop\smartlisafin\FinLegacy\src,C:\Progress\oe122\gui\,C:\Progress\oe122\gui\adecomm.pl,C:\Progress\oe122\gui\adecomp.pl,C:\Progress\oe122\gui\adedict.pl,C:\Progress\oe122\gui\adeedit.pl,C:\Progress\oe122\gui\adeicon.pl,C:\Progress\oe122\gui\adeshar.pl,C:\Progress\oe122\gui\adeuib.pl,C:\Progress\oe122\gui\adeweb.pl,C:\Progress\oe122\gui\adexml.pl,C:\Progress\oe122\gui\dataadmin.pl,C:\Progress\oe122\gui\prodict.pl,C:\Progress\oe122\gui\protools.pl,C:\Progress\oe122\gui\OpenEdge.Core.pl,C:\Progress\oe122\gui\OpenEdge.BusinessLogic.pl,C:\Progress\oe122\gui\netlib\OpenEdge.Net.pl,C:\Progress\oe122\src,C:\Progress\oe122,C:\Progress\oe122\bin,C:\Progress\oe122\tty,C:\cce\common,C:\Users\cvb\git\develop\smartlisafin\SmartFinCommon\src
Adding C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\cfg to PROPATH
Adding C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\src to PROPATH
Adding C:\Users\cvb\git\develop\ccesmarttools\SmartToolsCommon\src to PROPATH
Adding C:\Users\cvb\git\develop\ccesmarttools\SmartToolsBackend\src to PROPATH
Adding C:\Users\cvb\git\develop\ccesmarttools\SmartToolsFrontend\src to PROPATH
Adding C:\Users\cvb\git\develop\smartcomponentlibrary\src to PROPATH
Adding C:\Users\cvb\git\develop\smartcomponentlibrary to PROPATH
Adding C:\Users\cvb\git\develop\smartlisa\appl\src to PROPATH
Adding C:\Users\cvb\git\develop\smartlisafin\FinLegacy\src to PROPATH
Adding C:\Progress\oe122\gui to PROPATH
Adding C:\Progress\oe122\gui\adecomm.pl to PROPATH
Adding C:\Progress\oe122\gui\adecomp.pl to PROPATH
Adding C:\Progress\oe122\gui\adedict.pl to PROPATH
Adding C:\Progress\oe122\gui\adeedit.pl to PROPATH
Adding C:\Progress\oe122\gui\adeicon.pl to PROPATH
Adding C:\Progress\oe122\gui\adeshar.pl to PROPATH
Adding C:\Progress\oe122\gui\adeuib.pl to PROPATH
Adding C:\Progress\oe122\gui\adeweb.pl to PROPATH
Adding C:\Progress\oe122\gui\adexml.pl to PROPATH
Adding C:\Progress\oe122\gui\dataadmin.pl to PROPATH
Adding C:\Progress\oe122\gui\prodict.pl to PROPATH
Adding C:\Progress\oe122\gui\protools.pl to PROPATH
Adding C:\Progress\oe122\gui\OpenEdge.Core.pl to PROPATH
Adding C:\Progress\oe122\gui\OpenEdge.BusinessLogic.pl to PROPATH
Adding C:\Progress\oe122\gui\netlib\OpenEdge.Net.pl to PROPATH
Adding C:\Progress\oe122\src to PROPATH
Adding C:\Progress\oe122 to PROPATH
Adding C:\Progress\oe122\bin to PROPATH
Adding C:\Progress\oe122\tty to PROPATH
Adding C:\cce\common to PROPATH
Adding C:\Users\cvb\git\develop\smartlisafin\SmartFinCommon\src to PROPATH
CPD annotation : 'Generated'
CPD skip method : ''
CPD skip procedure : ''
Using backslash as escape character : false
Using schema : ../../ccesmarttools/dump/AUTH.df,../../ccesmarttools/dump/CCEREFACT.df,../../ccesmarttools/dump/DEVINFO.df,../../ccesmarttools/dump/LISA.df,../../ccesmarttools/dump/LISADMS.df,../../ccesmarttools/dump/LISALRAP.df,../../ccesmarttools/dump/MQDB.df
Parsing C:\Users\cvb\git\develop\ccesmarttools\dump\AUTH.df with alias AUTH
SonarLint side, using serialized file
Parsing C:\Users\cvb\git\develop\ccesmarttools\dump\CCEREFACT.df with alias CCEREFACT
SonarLint side, using serialized file
Parsing C:\Users\cvb\git\develop\ccesmarttools\dump\DEVINFO.df with alias DEVINFO
SonarLint side, using serialized file
Parsing C:\Users\cvb\git\develop\ccesmarttools\dump\LISA.df with alias LISA
SonarLint side, using serialized file
Parsing C:\Users\cvb\git\develop\ccesmarttools\dump\LISADMS.df with alias LISADMS
SonarLint side, using serialized file
Parsing C:\Users\cvb\git\develop\ccesmarttools\dump\LISALRAP.df with alias LISALRAP
SonarLint side, using serialized file
Parsing C:\Users\cvb\git\develop\ccesmarttools\dump\MQDB.df with alias MQDB
SonarLint side, using serialized file
Adding fromdb aliases to database LISA
Adding todb aliases to database LISA
Adding S_LISA aliases to database LISA
Parsing [uri=file:/C:/Users/cvb/git/develop/ccesmarttools/CceSmartTools/src/cceinc/select_count.p]
Parsing hierarchy of '[uri=file:/C:/Users/cvb/git/develop/ccesmarttools/CceSmartTools/src/cceinc/select_count.p]' - Relative 'cceinc\select_count.p'
  RCode found: 'null'
Listing file for '[uri=file:/C:/Users/cvb/git/develop/ccesmarttools/CceSmartTools/src/cceinc/select_count.p]' not found or contains space character - Was looking for 'null'
1 milliseconds to generate ParseUnit
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.OneStatementPerLine
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.ExpressionNoEffect
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.DefaultWidgetName
ActiveRule - Internal key  - Repository rssw-oe-main - Rule DEL_LOG
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.IncludeNameCasing
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.NoRoutineInWhere
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.AbbreviatedTableName
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.ClassNameCasing
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.WorkTableKeyword
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.SortAccessWholeIndexAnalyzer
ActiveRule - Internal key  - Repository rssw-oe - Rule org.sonar.plugins.openedge.checks.ClumsySyntax
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.IndentationCheck
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.ShareLock
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.ColonForBlock
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.UnusedBuffer
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.UnixKeyword
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.BackslashInIncludeFile
ActiveRule - Internal key  - Repository rssw-oe-main - Rule TXT_ID
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.NoUndo
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.BufferUsage
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.EmptyBlock
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.LowerCaseKeywords
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.WholeIndexAnalyzer
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.ToDoTracker
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.TooManyParameters
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.OutdatedDigest
ActiveRule - Internal key  - Repository rssw-oe - Rule org.sonar.plugins.openedge.checks.LargeTransactionScope
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.DotComment
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.EmptyFieldsList
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.TableScanAndWhere
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.UndefinedNamedInclude
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.FindFirst
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.ErrorHandlingDirective
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.SerializableError
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.TabsIndent
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.NoReturnInFuncOrMethod
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.UseIndex
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.NoReturnInFinally
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.LinesTooLong
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.EmptyStatement
ActiveRule - Internal key  - Repository consultingwerk-oe-main - Rule eu.rssw.cw.rules.EventWithoutCatch
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.WrongAssignWhen
ActiveRule - Internal key  - Repository rssw-oe-main - Rule source_procedure
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.ReadkeyKeyword
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.SubstituteLongChar
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.GlobalSharedVariable
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.HiddenVariable
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.AbbreviatedKeywords
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.DuplicateCase
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.BlockLabel
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.UsingStars
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.AvoidNoError
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.InvalidUseIndex
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.BackslashCurlyBrace
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.UnusedVariable
Initializing metadata of file file:/C:/Users/cvb/git/develop/ccesmarttools/CceSmartTools/src/cceinc/select_count.p
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.LogRethrowException
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.UnusedParameter
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.SortAccessAnalyzer
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.CommentedOutCode
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.SharedVariable
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.BackslashInString
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.DosKeyword
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.NoRoutineInLoop
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.DisableTriggers
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.EndType
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.OfLink
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.VariableAssignedButNotRead
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.UndoWithoutOption
ActiveRule - Internal key  - Repository rssw-oe-main - Rule message
ActiveRule - Internal key  - Repository rssw-oe-main - Rule eu.rssw.antlr.proparse.checks.PublicVariable
1 files proparse'd, 0 XML files, 0 listing files, 0 failure(s), 0 NCLOCs
AST Generation | time=1 ms
XML Parsing    | time=0 ms
Rule consultingwerk-oe-main:eu.rssw.cw.rules.EventWithoutCatch | time=0 ms
Rule rssw-oe-main:DEL_LOG | time=0 ms
Rule rssw-oe-main:TXT_ID | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.AbbreviatedKeywords | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.AbbreviatedTableName | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.AvoidNoError | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.BackslashCurlyBrace | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.BackslashInIncludeFile | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.BackslashInString | time=1 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.BlockLabel | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.BufferUsage | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.ClassNameCasing | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.ColonForBlock | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.CommentedOutCode | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.DefaultWidgetName | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.DisableTriggers | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.DosKeyword | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.DotComment | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.DuplicateCase | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.EmptyBlock | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.EmptyFieldsList | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.EmptyStatement | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.EndType | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.ErrorHandlingDirective | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.ExpressionNoEffect | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.FindFirst | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.GlobalSharedVariable | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.HiddenVariable | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.IncludeNameCasing | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.IndentationCheck | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.InvalidUseIndex | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.LinesTooLong | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.LogRethrowException | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.LowerCaseKeywords | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.NoReturnInFinally | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.NoReturnInFuncOrMethod | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.NoRoutineInLoop | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.NoRoutineInWhere | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.NoUndo | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.OfLink | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.OneStatementPerLine | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.OutdatedDigest | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.PublicVariable | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.ReadkeyKeyword | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.SerializableError | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.ShareLock | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.SharedVariable | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.SortAccessAnalyzer | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.SortAccessWholeIndexAnalyzer | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.SubstituteLongChar | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.TableScanAndWhere | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.TabsIndent | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.ToDoTracker | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.TooManyParameters | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.UndefinedNamedInclude | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.UndoWithoutOption | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.UnixKeyword | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.UnusedBuffer | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.UnusedParameter | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.UnusedVariable | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.UseIndex | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.UsingStars | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.VariableAssignedButNotRead | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.WholeIndexAnalyzer | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.WorkTableKeyword | time=0 ms
Rule rssw-oe-main:eu.rssw.antlr.proparse.checks.WrongAssignWhen | time=0 ms
Rule rssw-oe-main:message | time=0 ms
Rule rssw-oe-main:source_procedure | time=0 ms
Rule rssw-oe:org.sonar.plugins.openedge.checks.ClumsySyntax | time=0 ms
Rule rssw-oe:org.sonar.plugins.openedge.checks.LargeTransactionScope | time=0 ms
'OpenEdgeDBRulesSensor' skipped because there is no related file in current project
Execute Sensor: HTML
'XML Sensor' skipped because there is no related file in current project
'PHP sensor' skipped because there is no related file in current project
'Analyzer for "php.ini" files' skipped because there is no related file in current project
Found 2 issue(s)
Done in 247 ms

The original error I was trying to reproduce is

Syntax error -- <unknown> -- C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\src\cceinc\xuscnv-i.i:75:13 -- mismatched input 'select' expecting {<EOF>, END}
Error during code parsing for [uri=file:/C:/Users/cvb/git/develop/ccesmarttools/CceSmartTools/src/ccetools/ccefl-p.p] at position C:\Users\cvb\git\develop\ccesmarttools\CceSmartTools\src\cceinc\xuscnv-i.i:75:13

and line 75 is

            select count(*) into WZ-AANT-XU
                from XUSER where XUSER.GXU-CODE = TT-GXU.GXU-CODE and XUSER.XU-AKTIEF.
gquerret commented 3 years ago

The SQL statements were dropped during the transition to ANTRL4, so your original error is expected. But the shortened version should raise an error at line 4, while it gobbles every token after SELECT. Will be investigated.

cverbiest commented 3 years ago

Is there something I can put in the source to mark the unparsable code so that the parser skips it ?

define variable lList as character no-undo.
define variable lCountr as integer no-undo.
...
@LegacySyntax("begin").
select count(*) into lCountr from _user.
@LegacySyntax("end").
...

Just thinking, not really requesting unless it's already possible or if it's very low-hanging fruit.

gquerret commented 3 years ago

Will be easier to implement with proparse directive. I've quickly added support for {&_proparse_ skip-section} and {&_proparse_ end-skip-section}, will be available in 2.10. Any token found between those two directives are skipped (not even considered as comments or invisible tokens). Or would there be a better name for that ?

cverbiest commented 3 years ago

Proposed naming works for me, but I'd prefer {&proparse skip-section-start } and {&proparse skip-section-end }. That way a search for "&proparse skip-section" would show both start & end, and you can search for skip-section-start & skip-section-end as well

gquerret commented 3 years ago

Right!