SLIDE 2 RQ3: How frequent do bad practices occur in the Bash files?
- 8279/27167(30.5%) of files
exhibit no bad practices. Some files have extremely high number of errors <2000
Manual inspection
- Manual inspection of files with <2000 errors revel large files with
many of the same errors.
- Error SC2086 SC2162 SC2140 covers 7048/7091(99.39%) of all errors in these
files
Name Level Count Message SC2086 Info 5488 Double quote to prevent globbing and word splitting. SC2162 Info 804 read without -r will mangle backslashes SC2140 Warning 756 Word is on the form "A"B"C" (B indicated). Did you mean "ABC" or "A\"B\"C"?
RQ4: What is the distribution of bad practices in the Bash files? What are the common bad practices?
- Top 10 most seen errors are …
Rank Level Suggestion Count Message Group 1 info SC2086 130567 Double quote to prevent globbing and word splitting. Quote 2 style SC2006 13694 Use $(...) notation instead of legacy backticked `...`. Syntax 3 warning SC2034 12575 foo appears unused. Verify it or export it. Variable 4 info SC1091 8546 Not following: (error message here) Parsing 5 warning SC2154 7935 var is referenced but not assigned. Variable 6 warning SC2046 4919 Quote this to prevent word splitting Quote 7 style SC2002 4522 Useless cat. Consider 'cmd < file | ..' or 'cmd file | ..' instead. IO 8 error SC1041 4155 Found 'eof' further down, but not on a separate line. Parsing 9 error SC1072 4131 Unexpected .. Parsing 10 info SC2016 3362 Expressions don't expand in single quotes, use double quotes for that. Quote 11 info SC2162 3312 read without -r will mangle backslashes IO 12 error SC1073 3271 Couldn't parse this (thing). Fix to allow more checks. Parsing 13 warning SC2027 3214 The surrounding quotes actually unquote this. Remove or escape them. Quote 14 style SC2004 3161 $/${} is unnecessary on arithmetic variables. Variable 15 warning SC2164 3064 Use cd ... || exit in case cd fails. Error Handling
Occurrence of group in top 15 most common Suggestion
Group Count Percentage Parsing 20103 9.55% Companion 0.00% Syntax 13694 6.51% Variable 23671 11.25% Error Handling 3064 1.46% Quote 142062 67.51% IO 7834 3.72% Logic 0.00% sum: 210428