Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions SCC-OUTPUT-REPORT.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
<tbody><tr>
<th>Go</th>
<th>30</th>
<th>24445</th>
<th>1523</th>
<th>24601</th>
<th>1527</th>
<th>470</th>
<th>22452</th>
<th>1615</th>
<th>480648</th>
<th>6768</th>
<th>22604</th>
<th>1625</th>
<th>482875</th>
<th>6907</th>
</tr><tr>
<td>processor/constants.go</td>
<td></td>
Expand Down Expand Up @@ -70,6 +70,16 @@
<td>198</td>
<td>25365</td>
<td>493</td>
</tr><tr>
<td>main_test.go</td>
<td></td>
<td>687</td>
<td>54</td>
<td>15</td>
<td>618</td>
<td>179</td>
<td>16535</td>
<td>383</td>
</tr><tr>
<td>processor/processor.go</td>
<td></td>
Expand All @@ -80,16 +90,6 @@
<td>79</td>
<td>18242</td>
<td>416</td>
</tr><tr>
<td>main_test.go</td>
<td></td>
<td>531</td>
<td>50</td>
<td>15</td>
<td>466</td>
<td>169</td>
<td>14308</td>
<td>244</td>
</tr><tr>
<td>main.go</td>
<td></td>
Expand Down Expand Up @@ -280,16 +280,6 @@
<td>0</td>
<td>2209</td>
<td>35</td>
</tr><tr>
<td>processor/bloom.go</td>
<td></td>
<td>37</td>
<td>7</td>
<td>12</td>
<td>18</td>
<td>2</td>
<td>1062</td>
<td>29</td>
</tr><tr>
<td>processor/cocomo_test.go</td>
<td></td>
Expand All @@ -300,6 +290,16 @@
<td>6</td>
<td>686</td>
<td>23</td>
</tr><tr>
<td>processor/bloom.go</td>
<td></td>
<td>37</td>
<td>7</td>
<td>12</td>
<td>18</td>
<td>2</td>
<td>1062</td>
<td>29</td>
</tr><tr>
<td>processor/helpers_test.go</td>
<td></td>
Expand All @@ -324,15 +324,15 @@
<tfoot><tr>
<th>Total</th>
<th>30</th>
<th>24445</th>
<th>1523</th>
<th>24601</th>
<th>1527</th>
<th>470</th>
<th>22452</th>
<th>1615</th>
<th>480648</th>
<th>6768</th>
<th>22604</th>
<th>1625</th>
<th>482875</th>
<th>6907</th>
</tr>
<tr>
<th colspan="9">Estimated Cost to Develop (organic) $708,619<br>Estimated Schedule Effort (organic) 12.07 months<br>Estimated People Required (organic) 5.22<br></th>
<th colspan="9">Estimated Cost to Develop (organic) $713,657<br>Estimated Schedule Effort (organic) 12.10 months<br>Estimated People Required (organic) 5.24<br></th>
</tr></tfoot>
</table></body></html>
40 changes: 40 additions & 0 deletions examples/language/TOML.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# testing
title = "TOML examples"

int_value = 42
float_value = 3.1415

is_active = true
created_at = 2025-12-12T00:00:00+09:00

multiline_string = """
これは
複数行の
文字列です。
"""

colors = ["red", "green", "blue"]

# arrays
[[servers]]
name = "alpha"
ip = "192.168.1.1"

[[servers]]
name = "beta"
ip = "192.168.1.2"

[database]
server = "127.0.1.1"
ports = [ 8001, 8002, 8003 ]
connection_max = 5000
enabled = true

# nested
[owner]
name = "scc"
dob = 2000-07-01T12:00:00Z

[owner.contact]
address = "test"
phone = "+xx-xxx-xxx-xxxx"
1 change: 1 addition & 0 deletions examples/language/plain.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This a plain text file.
20 changes: 20 additions & 0 deletions examples/language/vim.vim
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
" func
function! ToggleLineNumbers()
if &number
set nonumber
echo "turn off line numbers"
else
set number
echo "turn on line numbers"
endif
endfunction

nnoremap <F2> :call ToggleLineNumbers()<CR>

" auto format go source code
autocmd BufWritePre *.go :silent! execute '%!gofmt'

set tabstop=4
set shiftwidth=4
set expandtab
set number
156 changes: 156 additions & 0 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,3 +529,159 @@ func TestDeterministicOutput(t *testing.T) {
}
}
}

func TestLanguageNameTruncate(t *testing.T) {
output, err := runSCC("examples/language")
if err != nil {
t.Fatal(err)
}
if strings.Count(output, "Bitbucket Pipe…") != 1 {
t.Errorf("`Bitbucket Pipeline` truncate test failed")
}
if strings.Count(output, "CloudFormation…") != 2 {
t.Errorf("`CloudFormation (JSON)` and `CloudFormation (YAML)` truncate test failed")
}
}

func TestSpecificLanguages(t *testing.T) {
languages := [...]string{
"ABNF",
"Alchemist",
"Algol 68",
"Alloy",
"Amber",
"ArkTs",
"Arturo",
"Astro",
"AWK",
"BASH",
"Bean",
"Bicep",
"Bitbucket Pipeline",
"Blueprint",
"Boo",
"Bosque",
"Bru",
"C3",
"C Shell",
"C#",
"Cairo",
"Cangjie",
"Chapel",
"Circom",
"Clipper",
"Clojure",
"CMake",
"Cuda",
"Cypher",
"D2",
"DAML",
"DM",
"Docker ignore",
"Dockerfile",
"DOT",
"Elixir Template",
"Elm",
"EmiT",
"F#",
"Factor",
"Flow9",
"FSL",
"Futhark",
"FXML",
"Gemfile",
"Gleam",
"Go",
"Go+",
"Godot Scene",
"GraphQL",
"Gremlin",
"Gwion",
"HAML",
"Hare",
"HCL",
"ignore",
"INI",
"Java",
"JavaScript",
"JCL",
"JSON5",
"JSONC",
"jq",
"Korn Shell",
"Koto",
"LALRPOP",
"License",
"LiveScript",
"LLVM IR",
"Lua",
"Luau",
"Luna",
"Makefile",
"Metal",
"Monkey C",
"Moonbit",
"Nushell",
"OpenQASM",
"OpenTofu",
"Perl",
"Pkl",
"Plain Text",
"POML",
"PostScript",
"Proto",
"Python",
"Q#",
"R",
"Racket",
"Rakefile",
"RAML",
"Redscript",
"Rich Text Format",
"Scallop",
"Seed7",
"Shell",
"Sieve",
"Slang",
"Slint",
"Smalltalk",
"Snakemake",
"Stan",
"Systemd",
"Tact",
"Teal",
"Tera",
"Templ",
"Terraform",
"TOML",
"TOON",
"TTCN-3",
"TypeScript",
"TypeSpec",
"Typst",
"Up",
"Vala",
"Vim Script",
"Web Services Description Language",
"wenyan",
"Wren",
"XMake",
"XML Schema",
"YAML",
"Yarn",
"Zig",
"ZoKrates",
"Zsh",
}

output, err := runSCC("-f", "csv", "examples/language")
if err != nil {
t.Fatal(err)
}

for _, language := range languages {
if !strings.Contains(output, language+",") {
t.Errorf("language not found in output: %v", language)
}
}
}
Loading
Loading