The other day, at work, I got excited with the story of "the most yabe function I repaired or wrote." Everyone talked a lot, but after all it was an overwhelming victory for the "command pattern main loop function (1500 lines)" I wrote. Why did you write such code?
So, today I will discover "the best function in the world" from github to heal my injured pride. In other words, "I'm going to see a Yabe function rather than a function I wrote."
Here, the Yabe function is identified by the following procedure.
Using github-trending-api, Look for Yabe functions by picking out popular projects from the last month in the following languages:
I don't do any tests cycro
The top 10 functions with high complexity without considering the contents of the code are as follows.
No | Complexity | Function name | Project name | Language name |
---|---|---|---|---|
1 | 5505 | jo | node | javascript |
2 | 2013 | matchIcon | edex-ui | javascript |
3 | 2001 | foo | llvm-project | cpp |
4 | 1947 | *global* | node | javascript |
5 | 1868 | cv::agast_cornerScore<AgastFeatureDetector::AGAST_7_12s> | opencv | cpp |
6 | 1647 | int | kubernetes | go |
7 | 1532 | foo | llvm-project | cpp |
8 | 1509 | OpenTag | SuiteCRM | php |
9 | 1504 | foo | llvm-project | cpp |
10 | 1453 | iT | node | javascript |
If you actually look at the contents of the code ...
No | Complexity | Function name | Project name | Language name | Remarks |
---|---|---|---|---|---|
1 | 5505 | jo | node | javascript | Because it is obfuscated |
2 | 2013 | matchIcon | edex-ui | javascript | Just line up 2000 if statements |
3 | 2001 | foo | llvm-project | cpp | For testing&&Just line up 2000 |
4 | 1947 | *global* | node | javascript | Because it is obfuscated |
5 | 1868 | cv::agast_cornerScore<AgastFeatureDetector::AGAST_7_12s> | opencv | cpp | This guy is bad |
6 | 1647 | int | kubernetes | go | Code automatically generated by the parser generator |
7 | 1532 | foo | llvm-project | cpp | Test code |
8 | 1509 | OpenTag | SuiteCRM | php | This guy is bad |
9 | 1504 | foo | llvm-project | cpp | Test code |
10 | 1453 | iT | node | javascript | Because it is obfuscated |
As described in the remarks column, the following two are really yabe functions. See the actual code with your own eyes! (Too long to stretch)
No | Complexity | Function name | Project name | Language name | Remarks |
---|---|---|---|---|---|
5 | 1868 | cv::agast_cornerScore<AgastFeatureDetector::AGAST_7_12s> | opencv | cpp | This guy is bad |
8 | 1509 | OpenTag | SuiteCRM | php | This guy is bad |
I plotted the complexity distribution for each language.
Excluding values outside the range of mean ± 2 * standard deviation for each language, it is as follows.
Forgive me if I make a mistake ...
Recommended Posts