loc

"lines of code" for 4D

View the Project on GitHub miyako/loc

version platform license downloads

loc

“lines of code” for 4D

dependencies.json

{
	"dependencies": {
		"loc": {
			"github": "miyako/loc",
			"version": "*"
		}
	}
}

macOS (wc -l)

Windows (findstr /r/n/s "^" + find /c ":")

remarks

the last line of a .4dm typically doesn’t end with \n or \r\n. this has an impact on how lines are counted on each platform.

TEST_form.4dm:1://%attributes = {}
TEST_form.4dm:2:#DECLARE($params : Object)
TEST_form.4dm:3:If (Count parameters:C259=0)
TEST_form.4dm:4:        CALL WORKER:C1389(1; Current method name:C684; {})
TEST_form.4dm:5:Else
TEST_form.4dm:6:        $form:=cs:C1710._locForm.new()
TEST_form.4dm:7:End if TEST_sync.4dm:1://%attributes = {}
TEST_sync.4dm:2:#DECLARE($params : Object)

in this example, the line count from each file totals 7+2=9, but the command reports 8.