Open ankoenigs opened 5 months ago
Hi @ankoenigs, Thank you for your use of the Spreadsheet Complexity Analyser, and reporting an issue. You don't have to provide the .cfg file name as a command line parameter. Use -c or --config. That is enough: the SCA will look for the config file "SpreadsheetComplexityAnalyser.cfg" in the tool's JAR folder. Note: save versions of your .cfg file under different, versioned mnemonic names.
Thank you for your quick and kind response!
Unfortunately, I still can't excatly get it to work. Now when I use -c
without any names specified, I get the following output/error message:
Error: config file not found! Using default values.
Exception in thread "main" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61)
Caused by: java.lang.NullPointerException: inStream parameter is null
at java.base/java.util.Objects.requireNonNull(Objects.java:248)
at java.base/java.util.Properties.load(Properties.java:409)
at ApachePOIExcelReader.readConfigFile(ApachePOIExcelReader.java:324)
at ApachePOIExcelReader.main(ApachePOIExcelReader.java:405)
... 5 more
I am confident that the config file has the right name and location, as I downloaded it by cloning this repo and did not change the file name, only the threshold values.
Hi ankoenigs,
This particular error with the InvocationTargetException seems to happen when the SCA can't find/read the cfg. file. If I change the .cfg's file name and use the -c parameter I get this error too. So either your filename was unintentionally changed or the SCA can't find the file.
Or if I start the jar file from somewhere outside it's directory I get the same error.
Fix: explicitly use the jar's folder instead of the folder that the user is in. This probably requires an update of line 404 of ApachePOIExcelReader.java.
For now, please ensure that you start the SCA from the folder where the jar file resides.
I modified the config file
SpreadsheetComplexityAnalyser.cfg
and tried executing SCA with the following command:I got the following output:
I believe the CLI option was used according to specs, using
-c="SpreadsheetComplexityAnalyser.cfg"
yields the ErrorError: cannot parse command line parameters:Unrecognized option: -c=SpreadsheetComplexityAnalyser.cfg
.I am using the following Java Version: