objectscriptQuality Release Notes

3.1.0

(25 May, 2020)

Since version 3.0.0 we have renamed our product to fit better the target language analyzed: ObjectScript. We have also renamed all the related products like objectscriptQuality for Caché Studio, objectscriptQuality for Aterlier and objectscriptQuality for VSCode.

What's new

  • Java 9 compatibility
  • Java 10 compatibility
  • Java 11 compatibility
  • Set of default profile adjusted to the most important rules
  • Accept readonly attribute on &html statement
  • Improvements on Class not found rule to avoid false positives:
    • Recognize usage of system classes if declared in a set comamand
      set xxx = %SYS%
  • Improvements on Variable not found rule to avoid false positives:
    • Consider $ListBuild function as a way for setting variables
    • Consider $ListNext function as a way for setting variables
    • Consider $Data ($D) function as as way for setting variables on its second argument
    • Consider READ command as as way for setting variables on its second argument
    • Consider $Order function as as way for setting variables on its second argument
    • Consider $Piece function as as way for setting variables in a set command
  • Improvements on Method not found rule to avoid false positives:
    • Consider auto-generated ExtentFunc (non-documented) when extending from %Persistent
    • Class autogenerated methods are taken in consideration
    • Recognize usage of system classes if declared in a set comamand
      set xxx = %SYS%
  • Improvements on Incompatible argument type in a method rule to avoid false positives:
    • Analize return type on functions when used as argument
    • Recognition of some system libraries
  • Incompatible argument type in a method now has an option to ignore the rule when it is unable to determine an argument type

Fixes

  • Event attributes on &html were not accepting ";" as valid javascript
  • Method not found rule was not considering parent class in some cases
  • Incompatible argument type in a method was not considering a {type} equivalent to LIBRARY.{type}
  • Variable not found was analyzing JSON strings
  • Error on read type of property on self class
  • Property not found was not recognizing properties in self class in some cases
  • Review on rule Quit whitout arguments to avoid false positive in some cases
  • Class not found was resolving wrong namespace in some cases
  • DependsOn modifier assignment can be empty
    Class Example [ DependsOn = , ProcedureBlock ]
  • System roles were not allowed as class Owner
    Class MyApp.Person Extends %Persistent [ Owner = {%Developer} ]  { //class members }
  • Allow usage of ellipsis for undetermined number of arguments in a label
    ZPM(pArgs...) Do ##class(%ZPM.PackageManager).Shell(pArgs...) Quit
  • Quote marks are optionals for %%INSERT and %%UPDATE on SqlComputeOnChange
  • Accept Deprecated as class modifier
  • Accept Language class modifier with value "objectscript"
    Method name(formal_spec) As returnclass [ Language = objectscript ] 
    {    //implementation }
  • Parameters starting with % on parameter list of Property definition where not allowed
    Property Payload As Patient(%JSONFIELDNAME = "package");
  • Accept the (ELEMENTS) or (KEYS) optional expression on INDEX
  • Minor review on parsing parameter list on Property definition
    Property Manifest As %Stream.GlobalCharacterSearchable(%SIMILARITYINDEX = "ManifestSearchIndex");
  • Manage optional spacing properly for macros

3.0.0

(27 December, 2019)

Since version 3.0.0 we have renamed our product to fit better the target language analyzed: ObjectScript. We have also renamed all the related products like objectscriptQuality for Caché Studio, objectscriptQuality for Aterlier and objectscriptQuality for VSCode.

What's new

  • Recognize #SQLCompile Path preprocessor directive
  • Recognize expressions in curly brackets

2.1.0

(15 July, 2019)

What's new

  • Ensemble Ready!
  • Accept JSON in XDATA body
  • Accept HTML expression between #
  • Accept deep class navigation on Index declaration
  • Recognition of a list of values in SqlComputeOnChange option on Property definition
    Property name As classname [ SqlComputed, SqlComputeCode=sqlcomputecode, SqlComputeOnChange = propertynames ];
  • More debug information added in case you get a parser error on a file
     

Fixes

  • Method not found rule now distinguishes between a property and a method in a class call like ..call(x), where 'call' can be a method or an array property
  • Empty method rule ignores foreign method to avoid false positives
  • Improvement on Method never invoked rule to detect inheritance in more cases
  • Incompatible argument type in a method was generating a null pointer parsing when type was not defined
  • SoapAction method modifier was not accepting a String

2.0.3

(20 February, 2019)

What's new

  • Exclusion list of rules that requires project context while analyzing just a file in SonarLint

2.0.2

(1 February, 2019)

Fixes

2.0.1

(28 January, 2019)

What's new

Full compatibility with SonarQube 7.3

2.0.0

(27 September, 2018)

Since this version, minimal SonarQube version required is 6.0

What's new

  • Ready for InterSystems IRIS platform
  • Compatibility with Sonarlint 2
  • Code Coverage support

Fixes

1.3.7

(17 August, 2018)

What's new

  • Recognize more keywords on @Relationship annotation: Calculated, SqlComputeCode, SqlComputed, Transient
  • Recognize specifications on class Query: CONTAINID, ROWSPEC, COMPILEMODE and SELECTMODE
  • Recognize the delimiters #classcontext and #endclasscontext
  • Accept instructions without quotation marks on &html statement
  • Recognize inheritance for rules evaluation
  • Recognize resulSet.Data("...") as %String type
  • Recognize a relationship accessor in a class
  • Recognize empty string as false when evaluting a boolean type
  • Support for ObjectScript function $MVOCONV
  • New "Best Practice" option for rule Variable not found to allow strict or flexible evaluation (previous versions were strict evaluation). Next are additional validations when Best Practice mode is enabled:
    • ByRef variables must be initialized
    • Exception variable in catch clause must be initialized
    • SQLCODE is considered declared and intialized after a &sql statement
    • Assignment to :variable in a &sql statement must be initialized

Fixes

  • Recognize property SqlViewName
  • Allow optional postconditional on TSTART
  • RFC metric was accounting references to any Method/ClassMethod more than once
  • Method not found rule reviewed for a better exclusion of %ShortPackageNames
  • Class not declared abstract rule has been reviewed accordingly to abstract definition discussed with different COS developer teams: A class should be abstract if all methods are empty or declared as abstract, then class should be abstract
  • Properly distinguish a variable that starts with sql in a logic sentence from &sql function
  • Recognize multiline comments after commands and method calls were without a space separator
  • Don't trigger Class not found rule for system classes. Now will recognize system classes if declared zn %SYS%
  • Don't trigger Method not found rule for system classes. Now will recognize system classes if declared zn %SYS%
  • Dont' trigger Missing argument(s) in method call rule when using ByRef and/or Output parameters
  • Dont' trigger Method not found rule for system classes
  • Review of accepted system variables on Variable not found rule to avoid false positives
  • Recognize comments inside a &html

1.3.6

(27 March, 2018)

What's new

Fixes

  • Resolved null pointer parsing in Class not found rule
  • Method not found rule now excludes checks for %Classes, %Methods and %ShortPackageNames
  • Incompatible argument type in a method rule was requiring initialization for variables passed by reference
  • Incompatible argument type in a method rule now considers %String as the default type for the parameters with no type
  • Method with unexpected arguments rule was not treating arguments with default value as arguments
  • Property not found rule now skips validation for properties of instancies of %Classes
  • Improvements on Variable not found rule to avoid false positives:
    • Now does not require to define a variable when calling $I(variable), as it is initiated automatically
    • Now does not require to define a variable when passed by reference
    • Now an argument used in a macro is considered to be initialized by the macro if not done before
    • Now does not require to initialize a variable used as argument in a macro
    • Was not recognizing #dim directive properly
    • Now recognizes variable declaration and initialization in a FOR

1.3.5

(4 February, 2018)

What's new

Updated for compatibility with SonarQube 6.7

1.3.4

(29 November, 2017)

Fixes

1.3.3

(30 October, 2017)

What's new

  • Parsing improvements for &js, &html

Fixes

  • Allow empty items in the include statement of a class
    Include (%syLDAP, %syLDAPFunc, , %sySite)
  • Allow variant with only indirection without assign for SET command
    s @("vrowcount="_vmc)
  • Correction on the Halstead Volume calculation, when it's zero
  • Allow null type on optional arguments
  • Incompatible argument type in a method fix when no type is declared

1.3.2

(16 October, 2017)

Fixes

  • Query As class with parameters

1.3.1

(11 October, 2017)

What's new

  • Added optional "as" in a #dim variables
  • Added optional property in SystemVars
  • Added comment (type ;comment) in #dim
  • Added parameter_list for a property
  • Accept comments for XML in XData
  • Support for legacy $ZSYNC command
  • Support for legacy $ZPREVIOUS command
  • Support for preprocessor directives:
    • #Undef
    • #elseif

Fixes

  • $ZP is a short for $ZPrevious
  • $ZPosition does not have a short
  • XData namespaces for tag
  • Corrected way to parse comments just after block
  • Allow null value for arguments
  • Pseudofields in Data modifier for Index
  • Empty statements line after dot
  • Custom Index with As class
  • Correction of spaces recognition between arguments

1.3.0

(26 September, 2017)

Fixes

  • Adoption of Complexity/Class and Complexity/Functions for newer versions of SonarQube
  • SqlFieldName modifier for Relationship
  • Sql in Query can contain braces {}
  • Indirection can be with almost everything which can return a string
  • Routines may even not have header
  • $[zobj][class]method().prop
  • {Property*N} or {Property*n} ignore case
  • $MVV on left side of SET command
  • PatternMatching also can be used with indirections
  • NEW command can be used with indirection
  • ZKill fixed parsing different types of arguments
  • Fixed parsing XData

1.2.0

(17 August, 2017)

This version ends support for SonarQube 5.1 or previous one. You need to upgrade to a newer SonarQube version if you have not done it already.

What's new

  • Compatibility with SonarQube 5.2 or higher
  • Added support for MAC/INT/INC in UDL (appeared in 2016.2) or RO format
  • Added ##SafeExpression directive support
  • Added #include preprocessor directive
  • #def1arg preprocessor directive
  • Support for ##sql directive
  • $zobj(var/mode/ref) functions added
  • Support for private/public procedures
  • CodeMode accepts generator for Trigger

Fixes

  • Macro in #Define can start with %
  • Fixes errors in parsing XData body
  • Ignore case for ##continue directive
  • Only '%' it is also valid identifier for methods or for variables.
  • SqlName modifier for classes and methods can be in quotes
  • Allow comments in flow control before code block
  • Fixed grammar for BREAK command
  • WHILE command can have multiple comma delimited conditions
  • @indirection with global variable
  • BREAK command with an argument (extend or flag)
  • CLOSE command with multiple arguments
  • Allow comment just after DO command dots line in the same line with label
  • Legacy if command without any arguments
  • $ZT is a short for $ZTRAP command
  • In a block with curly braces, first statement can be without space
  • Fixed error with macro comments
  • #Dim with "class" in double-quotes
  • Trigger code syntax access to property
  • Triple slash comment for documentation
  • Fixes in Pattern Matching

1.1.3

(8 August, 2017)

What's new

Relationship oneProp As classA [ Cardinality = one, Inverse = manyProp, InitialExpression = initialexpression ];

Fixes

  • Allow a postcondition in Job command
  • Allow a postcondition in Throw command
  • Minimal macrodefinition arguments count set to zero
  • Accept a counter reference property as argument for KILL command
    k ..Context.Data
  • Accept a local variable as argument for ZKILL command
  • Accept Language=cache in a Trigger definition
    Trigger Tr1 [ Event = INSERT, Language=cache ]
  • Accept row/object in a Foreach Trigger definition
    Trigger Tr2 [ Event = INSERT, Foreach = row/object ]
  • Allow spaces around expression in &html
  • Indirection with direct self property
    @i%Global@(\"subscript\")
  • Add field at hash reference class
    ##class({%%CLASSNAME}).%ClassName(1)
  • Allow self pointer grammar in $ZOBJ* functions
    $ZOBJPROPERTY(obj,name).%Id()

1.1.2

(4 July, 2017)

Fixes

  • $LOCK command is not managed properly
  • Class Index does not support Collation
  • Pattern Matching Expressions with Alternating Patterns not recognized

1.1.1

(31 May, 2017)

What's new

Fixes

    • Recognize #dim as valid between a try and catch statement
    • Review allowed DO command arguments
    • The first argument to $PROPERTY is optional

    1.1.0

    (29 August, 2016)

    Commercial release of cachéQuality, based on license model.

    What's new

    • Add $QUERY as a valid indirection target

    Fixes

    • Rule Unused method argument fails when the argument is used inside tags belonging to another language
    • Fix regular expression for HTML statics

    1.0.2

    (12 May, 2016)

    What's new

    1.0.1

    (2 May, 2016)

    What's new

    • Small refactor of namespaces for better understanding

    Fixes

    • Spelling mistake

    1.0.0

    (20 April, 2016)

    What's new

    This is the first version of the cachéQuality plugin, so everything is new!

    New rules