Giter Club home page Giter Club logo

sonar-xquery-plugin's People

Contributors

ligasgr avatar malteseduck avatar vladistan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sonar-xquery-plugin's Issues

Lexer: Recognize "TODO" comments

Update the lexer so that it recognizes the construct "(: TODO" as the beginning of a special "todo" comment (vs. the normal comment).

sonar-xquery-plugin with sonarqube-4.3 error report

HI, I am trying to use "sonar-xquery-plugin" with "sonarqube-4.3" and "sonar-runner-2.4" but the report is not showing "Issues" or "Technical Debt", I have the next configuration:

Note: Also I tested with other XQuery project but the result is the same, but with a Java project the Sonar report is good

  • xray-master/sonar-project.properties
# required metadata
sonar.projectKey=xray
sonar.projectName=xray
sonar.projectVersion=1.0

# optional description
sonar.projectDescription=xrayUnitTesting

# path to source directories (required)
sonar.sources=src

# The value of the property must be the key of the language.
sonar.language=xquery

# Encoding of the source code
sonar.sourceEncoding=UTF-8
  • "sonar-xquery-plugin-1.4.jar" in "sonarqube-4.3\extensions\plugins"
  • I executed "E:\TODO\sonarqube\xray-master>sonar-runner.bat"
E:\TODO\sonarqube\xray-master>sonar-runner.bat
E:\TODO\sonarqube\sonar-runner
SonarQube Runner 2.4
Java 1.7.0_51 Oracle Corporation (64-bit)
Windows 8 6.2 amd64
INFO: Runner configuration file: E:\TODO\sonarqube\sonar-runner\conf\sonar-runner.properties
INFO: Project configuration file: E:\TODO\sonarqube\xray-master\sonar-project.properties
INFO: Default locale: "es_CO", source code encoding: "UTF-8"
INFO: Work directory: E:\TODO\sonarqube\xray-master\.\.sonar
INFO: SonarQube Server 4.3
01:21:01.958 INFO  - Load batch settings
01:21:02.119 INFO  - User cache: C:\Users\norman.valencia\.sonar\cache
01:21:02.127 INFO  - Install plugins
01:21:02.255 INFO  - Install JDBC driver
01:21:02.261 WARN  - H2 database should be used for evaluation purpose only
01:21:02.261 INFO  - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
01:21:03.278 INFO  - Initializing Hibernate
01:21:04.963 INFO  - Load project settings
01:21:05.002 INFO  - Apply project exclusions
01:21:05.137 INFO  - -------------  Scan xray
01:21:05.143 INFO  - Load module settings
01:21:05.313 INFO  - Language is forced to xquery
01:21:05.508 INFO  - Loading technical debt model...
01:21:05.518 INFO  - Loading technical debt model done: 10 ms
01:21:05.519 INFO  - Loading rules...
01:21:05.815 INFO  - Loading rules done: 296 ms
01:21:05.828 INFO  - Configure Maven plugins
01:21:05.931 INFO  - Compare to previous analysis (2014-06-02)
01:21:05.939 INFO  - Compare over 30 days (2014-05-03, analysis of 2014-06-02 01:07:45.674)
01:21:05.940 INFO  - No quality gate is configured.
01:21:06.026 INFO  - Base dir: E:\TODO\sonarqube\xray-master\.
01:21:06.026 INFO  - Working dir: E:\TODO\sonarqube\xray-master\.\.sonar
01:21:06.026 INFO  - Source dirs: E:\TODO\sonarqube\xray-master\src
01:21:06.026 INFO  - Source encoding: UTF-8, default locale: es_CO
01:21:06.026 INFO  - Index files
01:21:06.080 INFO  - 6 files indexed
01:21:06.138 INFO  - Quality profile for xquery: Default Profile
01:21:06.156 INFO  - Sensor QProfileSensor...
01:21:06.160 INFO  - Sensor QProfileSensor done: 4 ms
01:21:06.161 INFO  - Sensor org.sonar.plugins.xquery.XQuerySensor@3660d903...
jun 02, 2014 1:21:06 AM org.sonar.plugins.xquery.rules.XQueryRulesRepository createChecks
Informaci¾n: Loading checks for profile Default Profile
jun 02, 2014 1:21:06 AM org.sonar.plugins.xquery.XQuerySensor analyse
Informaci¾n: Scanning all files to map dependencies
modules.xqy - line 23:4 - mismatched input '!' expecting RBRACKET
xray.xqy - line 54:17 - no viable alternative at input '('
xray.xqy - line 54:20 - no viable alternative at input ','
xray.xqy - line 95:17 - no viable alternative at input '('
xray.xqy - line 95:20 - no viable alternative at input ','
xray.xqy - line 113:6 - missing EOF at 'import'
jun 02, 2014 1:21:06 AM org.sonar.plugins.xquery.XQuerySensor analyse
Informaci¾n: Scanning all files and gathering metrics
01:21:06.609 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@7add5d94[resource=org.sonar.plugins.xquery.language.XQueryFile@5b79eeb2[key=assertions.xqy,dir=<null>,filename=assertions.xq
y,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<nu
ll>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the valu
e is an element) and include quantifiers on each type.,severity=<null>,lineId=21,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.610 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@7c17ed18[resource=org.sonar.plugins.xquery.language.XQueryFile@5b79eeb2[key=assertions.xqy,dir=<null>,filename=assertions.xq
y,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<nu
ll>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the valu
e is an element) and include quantifiers on each type.,severity=<null>,lineId=40,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.611 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@6cf024e[resource=org.sonar.plugins.xquery.language.XQueryFile@5b79eeb2[key=assertions.xqy,dir=<null>,filename=assertions.xqy
,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<nul
l>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the value
 is an element) and include quantifiers on each type.,severity=<null>,lineId=57,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.612 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@a05260[resource=org.sonar.plugins.xquery.language.XQueryFile@5b79eeb2[key=assertions.xqy,dir=<null>,filename=assertions.xqy,
unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null
>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the value
is an element) and include quantifiers on each type.,severity=<null>,lineId=74,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.613 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@1d801cf2[resource=org.sonar.plugins.xquery.language.XQueryFile@5b79eeb2[key=assertions.xqy,dir=<null>,filename=assertions.xq
y,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<nu
ll>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the valu
e is an element) and include quantifiers on each type.,severity=<null>,lineId=93,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.614 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@45ec62ff[resource=org.sonar.plugins.xquery.language.XQueryFile@5b79eeb2[key=assertions.xqy,dir=<null>,filename=assertions.xq
y,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<nu
ll>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the valu
e is an element) and include quantifiers on each type.,severity=<null>,lineId=96,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.615 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@22577736[resource=org.sonar.plugins.xquery.language.XQueryFile@5b79eeb2[key=assertions.xqy,dir=<null>,filename=assertions.xq
y,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<nu
ll>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the valu
e is an element) and include quantifiers on each type.,severity=<null>,lineId=113,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.615 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@1c538bd7[resource=org.sonar.plugins.xquery.language.XQueryFile@5b79eeb2[key=assertions.xqy,dir=<null>,filename=assertions.xq
y,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<nu
ll>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the valu
e is an element) and include quantifiers on each type.,severity=<null>,lineId=130,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.616 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@3101dec8[resource=org.sonar.plugins.xquery.language.XQueryFile@5b79eeb2[key=assertions.xqy,dir=<null>,filename=assertions.xq
y,unitTest=false],rule=Rule[id=584,name=Function Mapping Usage,key=FunctionMapping,configKey=FunctionMapping,plugin=xquery,severity=MAJOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message=Make sur
e you are intentionally using and/or understand function mapping - otherwise disable it with 'declare option xdmp:mapping "false";'  If you wish to use it you should explicitly declare 'declare option xdmp:mapping "true
";' for readability/maintainability.,severity=<null>,lineId=1,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.625 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@6f5d1ff4[resource=org.sonar.plugins.xquery.language.XQueryFile@4add054a[key=modules-database.xqy,dir=<null>,filename=modules
-database.xqy,unitTest=false],rule=Rule[id=582,name=Use Strong Typing when Declaring Module Variable,key=StrongTypingInModuleVariables,configKey=StrongTypingInModuleVariables,plugin=xquery,severity=CRITICAL,cardinality=
MULTIPLE,status=READY,language=xquery,parent=<null>],message=Declare types for declared variables to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element
()' instead of 'item()' when the value is an element) and include quantifiers on each type.,severity=<null>,lineId=5,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=
<null>,personId=<null>]
01:21:06.627 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@748663ab[resource=org.sonar.plugins.xquery.language.XQueryFile@4add054a[key=modules-database.xqy,dir=<null>,filename=modules
-database.xqy,unitTest=false],rule=Rule[id=589,name=Dynamic Function Usage,key=DynamicFunction,configKey=DynamicFunction,plugin=xquery,severity=MAJOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],mess
age=Avoid using xdmp:eval() and xdmp:value() where possible.  Instead use xdmp:invoke() or xdmp:unpath() or, if possible, function values to dynamically evaluate code logic.,severity=<null>,lineId=16,cost=<null>,created
At=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.628 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@22f9ab51[resource=org.sonar.plugins.xquery.language.XQueryFile@4add054a[key=modules-database.xqy,dir=<null>,filename=modules
-database.xqy,unitTest=false],rule=Rule[id=584,name=Function Mapping Usage,key=FunctionMapping,configKey=FunctionMapping,plugin=xquery,severity=MAJOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],mess
age=Make sure you are intentionally using and/or understand function mapping - otherwise disable it with 'declare option xdmp:mapping "false";'  If you wish to use it you should explicitly declare 'declare option xdmp:m
apping "true";' for readability/maintainability.,severity=<null>,lineId=1,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.644 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@1d631edd[resource=org.sonar.plugins.xquery.language.XQueryFile@567f4e3d[key=modules-filesystem.xqy,dir=<null>,filename=modul
es-filesystem.xqy,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=x
query,parent=<null>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item(
)' when the value is an element) and include quantifiers on each type.,severity=<null>,lineId=11,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<nul
l>]
01:21:06.645 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@3fe9b328[resource=org.sonar.plugins.xquery.language.XQueryFile@567f4e3d[key=modules-filesystem.xqy,dir=<null>,filename=modul
es-filesystem.xqy,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=x
query,parent=<null>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item(
)' when the value is an element) and include quantifiers on each type.,severity=<null>,lineId=15,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<nul
l>]
01:21:06.646 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@7f127e0[resource=org.sonar.plugins.xquery.language.XQueryFile@567f4e3d[key=modules-filesystem.xqy,dir=<null>,filename=module
s-filesystem.xqy,unitTest=false],rule=Rule[id=586,name=Avoid Operations in Predicates,key=OperationsInPredicate,configKey=OperationsInPredicate,plugin=xquery,severity=MAJOR,cardinality=MULTIPLE,status=READY,language=xqu
ery,parent=<null>],message=Instead of calling functions or performing operations in predicates try to assigning the results in a variable before the predicate.,severity=<null>,lineId=18,cost=<null>,createdAt=<null>,swit
chedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.647 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@6970e732[resource=org.sonar.plugins.xquery.language.XQueryFile@567f4e3d[key=modules-filesystem.xqy,dir=<null>,filename=modul
es-filesystem.xqy,unitTest=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=x
query,parent=<null>],message=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item(
)' when the value is an element) and include quantifiers on each type.,severity=<null>,lineId=26,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<nul
l>]
01:21:06.648 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@735ab9b2[resource=org.sonar.plugins.xquery.language.XQueryFile@567f4e3d[key=modules-filesystem.xqy,dir=<null>,filename=modul
es-filesystem.xqy,unitTest=false],rule=Rule[id=577,name=Range Evaluation in Order By Clause,key=OrderByRange,configKey=OrderByRange,plugin=xquery,severity=INFO,cardinality=MULTIPLE,status=READY,language=xquery,parent=<n
ull>],message=Order bys or gt/lt checks on large numbers of documents might get better performance with a range index.,severity=<null>,lineId=27,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false
,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.648 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@49559048[resource=org.sonar.plugins.xquery.language.XQueryFile@567f4e3d[key=modules-filesystem.xqy,dir=<null>,filename=modul
es-filesystem.xqy,unitTest=false],rule=Rule[id=584,name=Function Mapping Usage,key=FunctionMapping,configKey=FunctionMapping,plugin=xquery,severity=MAJOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],
message=Make sure you are intentionally using and/or understand function mapping - otherwise disable it with 'declare option xdmp:mapping "false";'  If you wish to use it you should explicitly declare 'declare option xd
mp:mapping "true";' for readability/maintainability.,severity=<null>,lineId=1,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
modules.xqy - line 23:4 - mismatched input '!' expecting RBRACKET
01:21:06.656 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@4c70ad1a[resource=org.sonar.plugins.xquery.language.XQueryFile@7974ad2a[key=modules.xqy,dir=<null>,filename=modules.xqy,unit
Test=false],rule=Rule[id=582,name=Use Strong Typing when Declaring Module Variable,key=StrongTypingInModuleVariables,configKey=StrongTypingInModuleVariables,plugin=xquery,severity=CRITICAL,cardinality=MULTIPLE,status=RE
ADY,language=xquery,parent=<null>],message=Declare types for declared variables to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'it
em()' when the value is an element) and include quantifiers on each type.,severity=<null>,lineId=10,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<
null>]
01:21:06.658 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@5b14deb1[resource=org.sonar.plugins.xquery.language.XQueryFile@7974ad2a[key=modules.xqy,dir=<null>,filename=modules.xqy,unit
Test=false],rule=Rule[id=582,name=Use Strong Typing when Declaring Module Variable,key=StrongTypingInModuleVariables,configKey=StrongTypingInModuleVariables,plugin=xquery,severity=CRITICAL,cardinality=MULTIPLE,status=RE
ADY,language=xquery,parent=<null>],message=Declare types for declared variables to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'it
em()' when the value is an element) and include quantifiers on each type.,severity=<null>,lineId=11,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<
null>]
01:21:06.659 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@3728652e[resource=org.sonar.plugins.xquery.language.XQueryFile@7974ad2a[key=modules.xqy,dir=<null>,filename=modules.xqy,unit
Test=false],rule=Rule[id=584,name=Function Mapping Usage,key=FunctionMapping,configKey=FunctionMapping,plugin=xquery,severity=MAJOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message=Make sure you
are intentionally using and/or understand function mapping - otherwise disable it with 'declare option xdmp:mapping "false";'  If you wish to use it you should explicitly declare 'declare option xdmp:mapping "true";' fo
r readability/maintainability.,severity=<null>,lineId=1,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.660 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@3d0acb4c[resource=org.sonar.plugins.xquery.language.XQueryFile@7974ad2a[key=modules.xqy,dir=<null>,filename=modules.xqy,unit
Test=false],rule=Rule[id=580,name=Code Parsing Error,key=ParseError,configKey=ParseError,plugin=xquery,severity=INFO,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message= - line 23:4 - mismatched inp
ut '!' expecting RBRACKET,severity=<null>,lineId=23,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.667 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@70e0023d[resource=org.sonar.plugins.xquery.language.XQueryFile@2b32cb0[key=output/json.xqy,dir=output,filename=json.xqy,unit
Test=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],m
essage=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the value is a
n element) and include quantifiers on each type.,severity=<null>,lineId=13,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.668 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@413ad832[resource=org.sonar.plugins.xquery.language.XQueryFile@2b32cb0[key=output/json.xqy,dir=output,filename=json.xqy,unit
Test=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],m
essage=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the value is a
n element) and include quantifiers on each type.,severity=<null>,lineId=14,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.669 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@7e47dc12[resource=org.sonar.plugins.xquery.language.XQueryFile@2b32cb0[key=output/json.xqy,dir=output,filename=json.xqy,unit
Test=false],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],m
essage=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the value is a
n element) and include quantifiers on each type.,severity=<null>,lineId=15,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.670 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@1fc16283[resource=org.sonar.plugins.xquery.language.XQueryFile@2b32cb0[key=output/json.xqy,dir=output,filename=json.xqy,unit
Test=false],rule=Rule[id=584,name=Function Mapping Usage,key=FunctionMapping,configKey=FunctionMapping,plugin=xquery,severity=MAJOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message=Make sure you
are intentionally using and/or understand function mapping - otherwise disable it with 'declare option xdmp:mapping "false";'  If you wish to use it you should explicitly declare 'declare option xdmp:mapping "true";' fo
r readability/maintainability.,severity=<null>,lineId=1,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
xray.xqy - line 54:17 - no viable alternative at input '('
xray.xqy - line 54:20 - no viable alternative at input ','
xray.xqy - line 95:17 - no viable alternative at input '('
xray.xqy - line 95:20 - no viable alternative at input ','
xray.xqy - line 113:6 - missing EOF at 'import'
01:21:06.691 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@159dbd6a[resource=org.sonar.plugins.xquery.language.XQueryFile@26fe853c[key=xray.xqy,dir=<null>,filename=xray.xqy,unitTest=f
alse],rule=Rule[id=582,name=Use Strong Typing when Declaring Module Variable,key=StrongTypingInModuleVariables,configKey=StrongTypingInModuleVariables,plugin=xquery,severity=CRITICAL,cardinality=MULTIPLE,status=READY,la
nguage=xquery,parent=<null>],message=Declare types for declared variables to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()'
when the value is an element) and include quantifiers on each type.,severity=<null>,lineId=8,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.691 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@fdd3a24[resource=org.sonar.plugins.xquery.language.XQueryFile@26fe853c[key=xray.xqy,dir=<null>,filename=xray.xqy,unitTest=fa
lse],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message=
Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the value is an eleme
nt) and include quantifiers on each type.,severity=<null>,lineId=18,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.692 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@514199f[resource=org.sonar.plugins.xquery.language.XQueryFile@26fe853c[key=xray.xqy,dir=<null>,filename=xray.xqy,unitTest=fa
lse],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message=
Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the value is an eleme
nt) and include quantifiers on each type.,severity=<null>,lineId=24,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.693 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@6a9e1853[resource=org.sonar.plugins.xquery.language.XQueryFile@26fe853c[key=xray.xqy,dir=<null>,filename=xray.xqy,unitTest=f
alse],rule=Rule[id=588,name=Use Strong Typing FLWOR Expressions,key=StrongTypingInFLWOR,configKey=StrongTypingInFLWOR,plugin=xquery,severity=MINOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message
=Declare types for FLWOR 'let' and 'for' clauses to increase readability and catch potential bugs.  Also try to scope the types as narrowly as possible (i.e. use 'element()' instead of 'item()' when the value is an elem
ent) and include quantifiers on each type.,severity=<null>,lineId=25,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.694 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@314f27d4[resource=org.sonar.plugins.xquery.language.XQueryFile@26fe853c[key=xray.xqy,dir=<null>,filename=xray.xqy,unitTest=f
alse],rule=Rule[id=584,name=Function Mapping Usage,key=FunctionMapping,configKey=FunctionMapping,plugin=xquery,severity=MAJOR,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message=Make sure you are in
tentionally using and/or understand function mapping - otherwise disable it with 'declare option xdmp:mapping "false";'  If you wish to use it you should explicitly declare 'declare option xdmp:mapping "true";' for read
ability/maintainability.,severity=<null>,lineId=1,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.694 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@43bfe896[resource=org.sonar.plugins.xquery.language.XQueryFile@26fe853c[key=xray.xqy,dir=<null>,filename=xray.xqy,unitTest=f
alse],rule=Rule[id=580,name=Code Parsing Error,key=ParseError,configKey=ParseError,plugin=xquery,severity=INFO,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message= - line 54:17 - no viable alternati
ve at input '(',severity=<null>,lineId=54,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.695 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@6c3ef299[resource=org.sonar.plugins.xquery.language.XQueryFile@26fe853c[key=xray.xqy,dir=<null>,filename=xray.xqy,unitTest=f
alse],rule=Rule[id=580,name=Code Parsing Error,key=ParseError,configKey=ParseError,plugin=xquery,severity=INFO,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message= - line 95:17 - no viable alternati
ve at input '(',severity=<null>,lineId=95,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.696 WARN  - Resource is not indexed. Ignoring violation org.sonar.api.rules.Violation@18a95254[resource=org.sonar.plugins.xquery.language.XQueryFile@26fe853c[key=xray.xqy,dir=<null>,filename=xray.xqy,unitTest=f
alse],rule=Rule[id=580,name=Code Parsing Error,key=ParseError,configKey=ParseError,plugin=xquery,severity=INFO,cardinality=MULTIPLE,status=READY,language=xquery,parent=<null>],message= - line 113:6 - missing EOF at 'imp
ort',severity=<null>,lineId=113,cost=<null>,createdAt=<null>,switchedOff=false,checksum=<null>,isNew=false,isManual=false,permanentId=<null>,personId=<null>]
01:21:06.697 INFO  - Sensor org.sonar.plugins.xquery.XQuerySensor@3660d903 done: 536 ms
01:21:06.697 INFO  - Sensor org.sonar.plugins.xquery.xqtest.XQTestSensor@10476fd9...
jun 02, 2014 1:21:06 AM org.sonar.plugins.xquery.xqtest.XQTestSensor collect
Informaci¾n: parsing E:\TODO\sonarqube\xray-master\target\xqtest-reports
01:21:06.699 WARN  - Reports path not found: E:\TODO\sonarqube\xray-master\target\xqtest-reports
01:21:06.700 INFO  - Sensor org.sonar.plugins.xquery.xqtest.XQTestSensor@10476fd9 done: 3 ms
01:21:06.700 INFO  - Sensor CpdSensor...
01:21:06.700 INFO  - Sensor CpdSensor done: 0 ms
01:21:06.700 INFO  - Sensor InitialOpenIssuesSensor...
01:21:06.709 INFO  - Sensor InitialOpenIssuesSensor done: 9 ms
01:21:06.710 INFO  - Sensor ProfileEventsSensor...
01:21:06.728 INFO  - Sensor ProfileEventsSensor done: 18 ms
01:21:06.729 INFO  - Sensor ProjectLinksSensor...
01:21:06.733 INFO  - Sensor ProjectLinksSensor done: 4 ms
01:21:06.734 INFO  - Sensor VersionEventsSensor...
01:21:06.744 INFO  - Sensor VersionEventsSensor done: 10 ms
01:21:06.744 INFO  - Sensor FileHashSensor...
01:21:06.749 INFO  - Sensor FileHashSensor done: 5 ms
01:21:07.110 INFO  - Execute decorators...
01:21:07.357 INFO  - Store results in database
01:21:07.395 INFO  - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/xray
01:21:07.419 INFO  - Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
01:21:07.420 INFO  - Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
01:21:07.427 INFO  - Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
01:21:07.435 INFO  - -> Keep one snapshot per day between 2014-05-05 and 2014-06-01
01:21:07.436 INFO  - -> Keep one snapshot per week between 2013-06-03 and 2014-05-05
01:21:07.436 INFO  - -> Keep one snapshot per month between 2009-06-08 and 2013-06-03
01:21:07.436 INFO  - -> Delete data prior to: 2009-06-08
01:21:07.441 INFO  - -> Clean xray [id=1]
01:21:07.444 INFO  - <- Clean snapshot 1
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 6.330s
Final Memory: 15M/585M
INFO: ------------------------------------------------------------------------

E:\TODO\sonarqube\xray-master>
  • But the result in the dashboard does not have a correct analisys
    xray_sonarqube

Note: The same "sonar-xquery-plugin-1.4.jar" in "sonar-3.5.1\extensions\plugins" works correctly
xray_sonar-3 5

Do you have any idea?
Thanks.

Build failure cannot build ANTLR parser

When trying to do build using Maven 3.3.9 I get the following error:

INFO] ANTLR: Processing source directory /Users/vlad/Proj/sonar-xquery-plugin/src/main/antlr3
ANTLR Parser Generator Version 3.1.3 Mar 17, 2009 19:23:44
org/sonar/plugins/xquery/parser/XQueryLexer.g
org/sonar/plugins/xquery/parser/XMLLexer.g
org/sonar/plugins/xquery/parser/StringLexer.g
org/sonar/plugins/xquery/parser/XQueryParser.g
error(10): internal error: Can't get property indirectDelegates using method get/isIndirectDelegates from org.antlr.tool.Grammar instance : java.lang.NullPointerException
java.util.Objects.requireNonNull(Objects.java:203)
java.util.ArrayList.removeAll(ArrayList.java:689)
org.antlr.tool.CompositeGrammar.getIndirectDelegates(CompositeGrammar.java:222)

mvn install org.codehaus.sonar:sonar-dev-maven-plugin::start-war

Hi, I have a problem executing "mvn install org.codehaus.sonar:sonar-dev-maven-plugin::start-war -Dsonar.runtimeVersion=3.5" command as the documentation says in "README.md", well, the situation is the next::

  1. I downloaded the "sonar-xquery-plugin-master.zip" from https://github.com/malteseduck/sonar-xquery-plugin/archive/master.zip
  2. I did unzip "sonar-xquery-plugin-master.zip" in "E:\TODO\sonarqube\sonar-xquery-plugin-master" path (I am using windows 8.1)
  3. I went to the "E:\TODO\sonarqube\sonar-xquery-plugin-master" by "cmd" (windows console) and I written "mvn install org.codehaus.sonar:sonar-dev-maven-plugin::start-war -Dsonar.runtimeVersion=3.5", but after the dependencies were downloaded and a error was showed ([ERROR] Could not find goal 'start-war' in plugin org.codehaus.sonar:sonar-dev-maven-plugin:1.8 among available goals help) -- please see the images.

sonarqube_error_1
sonarqube_error_2

Could you let me know what is the problem or what I am doing wrong?
Thanks.

test coverage?

Hi, thanks for the plugin! I've tried using it and it works with some caveats (we're using Xquery 3.0 constructs like ! and ||). However, one thing I didn't manage to get output for is test coverage. Is there something particular to configure, or is this a future feature?

SonarQube 6.x Support

Do you have plans to support SonarQube 6.x? Or do you have a work-a-round how to run the existing plugin on 6.2?

Trying to build XQuery3 branch for use with SonarQube 5.6.3

Hi, I'm looking to get the XQuery3 branch up and running on an older version of SonarQube to determine what kind of work would need to be done to get an update to SonarQube 8, but I'm running into issues getting it the branch to build. Looking for any help to get the build running.

Thanks!

MVN Compile gives back the following (Maven 3.6.0, Java 1.8.0_232)

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sonar-xquery-plugin: Compilation failure: Compilation failure:
[ERROR] /Users/kstoltz/development/sonar-xquery-plugin/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[13,35] cannot find symbol
[ERROR] symbol: class MultiChannelBaseParser
[ERROR] /Users/kstoltz/development/sonar-xquery-plugin/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[218,9] method does not override or implement a method from a supertype
[ERROR] /Users/kstoltz/development/sonar-xquery-plugin/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[224,9] method does not override or implement a method from a supertype
[ERROR] /Users/kstoltz/development/sonar-xquery-plugin/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[230,9] method does not override or implement a method from a supertype
[ERROR] /Users/kstoltz/development/sonar-xquery-plugin/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[233,9] method does not override or implement a method from a supertype
[ERROR] /Users/kstoltz/development/sonar-xquery-plugin/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[236,9] method does not override or implement a method from a supertype
[ERROR] /Users/kstoltz/development/sonar-xquery-plugin/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[239,9] method does not override or implement a method from a supertype
[ERROR] /Users/kstoltz/development/sonar-xquery-plugin/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[244,17] cannot find symbol
[ERROR] symbol: variable _interp
[ERROR] location: class org.sonar.plugins.xquery.parser.XQueryParser
[ERROR] /Users/kstoltz/development/sonar-xquery-plugin/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[244,50] incompatible types: org.sonar.plugins.xquery.parser.XQueryParser cannot be converted to org.antlr.v4.runtime.Parser
...

Build failure in branch xquery3

When trying to build using Maven 3.6.0 and Java version 1.8.0_172, I get the following error in the xquery3 branch:

[ERROR] /Users/lcahlander/Downloads/sonar-xquery-plugin-xquery3/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[13,35] cannot find symbol
[ERROR] symbol: class MultiChannelBaseParser
[ERROR] /Users/lcahlander/Downloads/sonar-xquery-plugin-xquery3/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[218,9] method does not override or implement a method from a supertype
[ERROR] /Users/lcahlander/Downloads/sonar-xquery-plugin-xquery3/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[224,9] method does not override or implement a method from a supertype
[ERROR] /Users/lcahlander/Downloads/sonar-xquery-plugin-xquery3/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[230,9] method does not override or implement a method from a supertype
[ERROR] /Users/lcahlander/Downloads/sonar-xquery-plugin-xquery3/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[233,9] method does not override or implement a method from a supertype
[ERROR] /Users/lcahlander/Downloads/sonar-xquery-plugin-xquery3/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[236,9] method does not override or implement a method from a supertype
[ERROR] /Users/lcahlander/Downloads/sonar-xquery-plugin-xquery3/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[239,9] method does not override or implement a method from a supertype
[ERROR] /Users/lcahlander/Downloads/sonar-xquery-plugin-xquery3/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[244,17] cannot find symbol
[ERROR] symbol: variable _interp
[ERROR] location: class org.sonar.plugins.xquery.parser.XQueryParser
[ERROR] /Users/lcahlander/Downloads/sonar-xquery-plugin-xquery3/target/generated-sources/antlr4/org/sonar/plugins/xquery/parser/XQueryParser.java:[244,50] incompatible types: org.sonar.plugins.xquery.parser.XQueryParser cannot be converted to org.antlr.v4.runtime.Parser
.
.
.

Want to display XQuery analysis report on SonarQube and not on command line

I am using the XQuery plugin 2.0 created according to the steps mentioned by malteseduck. I added the plugin to "SonarqQube/extentions/plugins" folder. Tested the Xquery code using sonar scanner. I can see the error, issues as INFO on the command line. My project demands to display the errors/issues on SonarQube dashboard. Is there any setting to be done to direct the analysis report to SonarQube server ? or is there any other way I can display the analysis report on SonarQube dashboard.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.