What is a line of code and how Highlight counts them
- var foo = 42; => 1 line of code
- var foo = 42; foo += 12; => 1 line of code
- var foo = 42; // some comment => 1 line of code
- { => 1 line of code
- } => 1 line of code
- { var foo = 42; } => 1 line of code
- // some comment => 0 line of code
- // var foo = 42 => 0 line of code
- BLANK/EMPTY LINE => 0 line of code
Some basic examples
var foo = 42; // my favorite number
var misc = 4;
while(misc > 0) {
  // foo = foo – misc;
  foo -= misc;
  misc -= 1;
}
/**
The result should be something like 32
**/
alert(foo);
include(‘functions.php’);
/**
THIS IS A PHP SCRIPT
**/
$foo = 42; $i = 10;
while($i > 0)
{
  $foo = $foo – $i;
  $i = $i – 1;
}
?>
<div>
 <strong><?=$foo?></strong>
</div>
Q&As
If the generated code is part of the scan scope and written in one of the technologies supported by CAST Highlight, it will be taken into account.
Are project or configuration files taken into account in lines of code?
Project and configuration files such as pom.xml, .json, .vcsproj … are not counted as lines of code.
Are binary files taken into account in lines of code?
Binary files such as JARs, DLLs, EXEs … are not counted as lines of code.
Are third-party component lines of code taken into account?
Yes, if third-party component files are readable source code (i.e., not binary files) and not excluded from the scan (e.g., minified files in JavaScript are automatically excluded from the analysis).