--- a/tool/src/spdxlib/FileInfo.java
+++ b/tool/src/spdxlib/FileInfo.java
@@ -106,6 +106,26 @@
return fileName;
}
+
+ /**
+ * How many lines of code has this file?
+ * @return the number of lines (approximation)
+ */
+ public int getLOC(){
+ // no need to continue if fully empty
+ if(tagFileLOC == null){
+ return 0;
+ }
+
+
+ int result = 0;
+ try{
+ result = utils.text.justNumbers(tagFileLOC.getValue());
+ }catch (Exception e){
+ System.err.println("Error reading LOC");
+ }
+ return result;
+ }
/**