Anti-GUR-Checker/249GURUtility.h
2023-11-16 20:06:50 -07:00

299 lines
No EOL
9 KiB
C

/*
Name: checkForSingleLetterVariable (GUR 1 - 249)
Process: checks for single letter variables in code, warns if there may be a
variable that is less than three letters long. Will only warn at the
definition of a variable and within function declaration.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForCurlyBraces (GUR 2 - 249)
Process: checks for missing or non aligned curly braces, will warn if there are
unaligned or missing braces.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForRedundantBoolean (GUR 3 - 249)
Process: checks for redundant boolean test, in other words, if there is a bool
expression, and that is being compared to true or false.
e.g. <boolean expression> == true or == false
Warns if an a bool type is going to be compared to true or false.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForDoubleIf (GUR 4 - 249)
Process: checks for back to back if statements. This comes down to the programmer
logic to make sure, but will warn for "double if" if there is two if
statements that could be logically else or else if. Will warn if there
are two if statements found next to each other.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForDataStateChange (GUR 5 - 249)
Process: checks for increment or decrementing changes within an array call or
function call. Warns if there is any function parameter found with a
state change, or if there is an array call parameter with a data change.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForDeclaredLoopVariable (GUR 6 - 249)
Process: checks for any variable that is declared WITHIN a loop, either in the
loop's parameter, or inside the loop itself. Warns if any variable type
if declared within the code block of a loop.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForIncompleteForLoop (GUR 7 - 249)
Process: checks for an incomplete for loop. Looks for all three parameters
present, with their semicolons in the correct place. Warns if any of the
three parameters have only semicolons.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForBooleanRedundancy (GUR 8 - 249)
Process: checks for the return statement of a bool function, if it is a boolean
statement. If it isn't, this may warn the user about compressing logic
to their return statement in place of if/else logic.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForCodeWithCurlyBraces (GUR 9 - 249)
Process: checks for curly braces on the same line as code, in other words, if
there is a curly brace that isn't aligned with a code block properly.
Warns if there is a code block that has curly braces with no newline
between them.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForBooleanReplacement (GUR 10 - 249)
Process: checks for if any integer may be used in place of true or false. Warns
if there is potential for an integer being used this way.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForUseOfLiterals (GUR 11 - 249)
Process: checks for any C-type literal, warns if the literal is not a variable.
Might also warn if a literal is used over and over.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForBreakUsage (GUR 12 - 249)
Process: checks for the C keyword "break" used anywhere but within a switch code
block. Warns if a break statement is in a code block without "switch."
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForGlobalVariables (GUR 13 - 249)
Process: checks for variables that are outside ANY code block. Warns if a
defined variable is outside any code block.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForTabs (GUR 14 - 249)
Process: checks for tabs being used. This is partially a warning, as Lev never
likes tabs. Warns if the "\t" character is detected.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForEmptyReturn (GUR 15 - 249)
Process: checks for any return without a value attached. Warns if there is a
return inside a code block with a semicolon directly after.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForContinue (GUR 16 - 249)
Process: checks for the continue keyword in any code block. Warns if the
keyword is used in any circumstance.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForIOFunctions (GUR 17 - 249)
Process: checks for IO functions in any code block. Warns the user when the IO
function count is less than 4 in any given code block.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForFunctionsInParameters (GUR 18 - 249)
Process: checks for function calls within code parameters. Warns the user of use
of functions being used as parameters, or within array brackets.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForEmptyIf (GUR 19 - 249)
Process: checks for empty if or else blocks. Warns the user if the code block for
an if statement or an else statement is empty.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForEightyCharacterLimit (GUR 20 - 249)
Process: checks for any line that exceeds 80 characters. Warns the user if any
line defined as between two "\n" characters exceeds 80.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForDisallowedOperations (GUR 21 - 249)
Process: checks for ternary operators, goto, for/each, keywords that aren't used
within CS249. Warns the user when any of these operations are used either
globally or within any code block.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForUnspecifiedFunctions (GUR 22 - 249)
Process: checks for use of any functions that are not within the original/given
header file. Warns the user if the compared header file is not like the
C file.
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkForUseOfShorthandOperators (GUR W1 - 249)
Process: checks for the use of shorthand operators. Warns the user if there is
any "++" "--" "+=" & "-=" inside code blocks
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/
/*
Name: checkFor (GUR W? - 249)
Process: checks for
Function input/parameters: ???
Function output/parameters: ???
Function output/returned: ???
Device input/ ---: ???
Device output/ ---: ???
Dependencies: ???
*/