Skip to content

Simple script to forecast credits usage for source code scans on Copyleaks

License

Notifications You must be signed in to change notification settings

Copyleaks/token-counter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Token Counter

Token Counter is a python script written by Copyleaks, to forecast credits usage for source code scans on the Copyleaks platform.

Help

python3 main.py -h

output:
usage: main.py [-h] --directory DIRECTORY

options:
  -h, --help            show this help message and exit
  --directory DIRECTORY, -d DIRECTORY
                        Directory to scan for source code files

Usage

python3 main.py -d CODE_DIRECTORY

Example

python3 main.py -d CODE_DIRECTORY

output:

74 files found
*.py:
        Files: 36
        Tokens: 36,960
        Average Token count: 1,027

*.cs:
        Files: 21
        Tokens: 9,301
        Average Token count: 443

*.java:
        Files: 2
        Tokens: 6,189
        Average Token count: 3,095

*.js:
        Files: 5
        Tokens: 937
        Average Token count: 188

*.css:
        Files: 1
        Tokens: 125
        Average Token count: 125

*.php:
        Files: 2
        Tokens: 576
        Average Token count: 288

*.rb:
        Files: 2
        Tokens: 247
        Average Token count: 124

*.scala:
        Files: 2
        Tokens: 664
        Average Token count: 332

*.swift:
        Files: 2
        Tokens: 1,157
        Average Token count: 579

About

Simple script to forecast credits usage for source code scans on Copyleaks

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages