Getting Error : Not a valid line offset for pointer

  • sonar-scanner-cli-4.2.0.1873-windows

  • error observed: java.lang.IllegalArgumentException: 64 is not a valid line offset for pointer. File test.groovy has 63 character(s) at line 3

  • potential workaround: No workaround yet

Whole code is:

try {
setAttribute(‘RequestedTimeSlot’, ‘NA’);
if(WoArea == “AC Power – Canada” || WoArea == “AC Power - US”)
{
if (WoTypeId == 300000890102345) {
setAttribute(‘AreaType_c’, “AC_POWER_MAINTENANCE”)
} else if (WoTypeId == 300000890102347) {
setAttribute(‘AreaType_c’, “AC_POWER_INSTALL”)
} else if (WoTypeId == 300000890102341) {
setAttribute(‘AreaType_c’, “AC_POWER_EMERGENCY”)
} else if (WoTypeId == 300000890102343) {
setAttribute(‘AreaType_c’, “AC_POWER_PM”)
} else if (WoTypeId == 300000890102346) {
setAttribute(‘AreaType_c’, “AC_POWER_START_UP”)
} else if (WoTypeId == 300000890102342) {
setAttribute(‘AreaType_c’, “AC_POWER_TRAINING”)
} else {
setAttribute(‘AreaType_c’, null)
}
}

else if (WoArea == ‘DC Power - US’ || WoArea == ‘DC Power – Canada’) {
if (WoTypeId == 300000890102345) {
setAttribute(‘AreaType_c’, “DC_POWER_MAINTENANCE”)
} else if (WoTypeId == 300000890102347) {
setAttribute(‘AreaType_c’, “DC_POWER_INSTALL”)
} else if (WoTypeId == 300000890102341) {
setAttribute(‘AreaType_c’, “DC_POWER_EMERGENCY”)
} else if (WoTypeId == 300000890102343) {
setAttribute(‘AreaType_c’, “DC_POWER_PM”)
} else if (WoTypeId == 300000890102346) {
setAttribute(‘AreaType_c’, “DC_POWER_START_UP”)
} else {
setAttribute(‘AreaType_c’, null)
}
}

else {
setAttribute(‘AreaType_c’, null)
}
} catch (e) {
adf.error.raise(null)
}

Hi,

Welcome to the community!

Could you clarify what language we’re talking about here?

 
Thx,
Ann

Hello Ann,

We are writing Groovy scripts here.

Thanks,
Shivam

Hi Shivam,

The Groovy analyzer is community-supported (actually, I’m not sure there’s much support/maintenance going on…).

You should try creating an issue on that project.

 
HTH,
Ann

Thanks for quick reply Ann.

Can you direct me to the project/community for Groovy ?

Also I am using this scanner: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner/

Hi,

 
Ann