configuration/constants/word.constants.ts

configuration/constants/word.constants.ts is a file in GovLab Quality. 110 lines of code and 4 definitions.

export const SYNONYMS: ReadonlyMap<string, string> = new Map([
    ["arg", "parameter"],
    ["args", "parameter"],
    ["argument", "parameter"],
    ["arguments", "parameter"],
    ["assign", "assignment"],
    ["assigned", "assignment"],
    ["assigning", "assignment"],
    ["assignments", "assignment"],
    ["blank", "empty"],
    ["classes", "class"],
    ["clone", "duplicate"],
    ["clones", "duplicate"],
    ["commented", "comment"],
    ["comments", "comment"],
    ["compared", "compare"],
    ["compares", "compare"],
    ["comparing", "compare"],
    ["comparison", "compare"],
    ["complex", "complexity"],
    ["const", "constant"],
    ["constants", "constant"],
    ["declarations", "declaration"],
    ["declare", "declaration"],
    ["declared", "declaration"],
    ["declares", "declaration"],
    ["deprecate", "deprecated"],
    ["deprecates", "deprecated"],
    ["duplicated", "duplicate"],
    ["duplicates", "duplicate"],
    ["duplication", "duplicate"],
    ["encrypt", "encryption"],
    ["encrypted", "encryption"],
    ["encrypting", "encryption"],
    ["equal", "equality"],
    ["equals", "equality"],
    ["exceptions", "exception"],
    ["fn", "function"],
    ["func", "function"],
    ["functions", "function"],
    ["hardcode", "hardcoded"],
    ["hardcoding", "hardcoded"],
    ["imported", "import"],
    ["importing", "import"],
    ["imports", "import"],
    ["indent", "indentation"],
    ["indented", "indentation"],
    ["indents", "indentation"],
    ["indexes", "index"],
    ["indices", "index"],
    ["inject", "injection"],
    ["injected", "injection"],
    ["int", "number"],
    ["integer", "number"],
    ["len", "length"],
    ["lengths", "length"],
    ["lines", "line"],
    ["literal", "constant"],
    ["literals", "constant"],
    ["long", "length"],
    ["longer", "length"],
    ["looping", "loop"],
    ["loops", "loop"],
    ["method", "function"],
    ["methods", "function"],
    ["nesting", "nested"],
    ["nil", "null"],
    ["nullable", "null"],
    ["nullptr", "null"],
    ["num", "number"],
    ["numbers", "number"],
    ["numeric", "number"],
    ["obsolete", "deprecated"],
    ["param", "parameter"],
    ["parameters", "parameter"],
    ["params", "parameter"],
    ["parens", "paren"],
    ["parenthese", "paren"],
    ["parentheses", "paren"],
    ["parenthesis", "paren"],
    ["permissions", "permission"],
    ["pointless", "redundant"],
    ["procedure", "function"],
    ["properties", "property"],
    ["redundancy", "redundant"],
    ["returned", "return"],
    ["returning", "return"],
    ["returns", "return"],
    ["space", "whitespace"],
    ["spaces", "whitespace"],
    ["spacing", "whitespace"],
    ["str", "string"],
    ["strings", "string"],
    ["subroutine", "function"],
    ["superfluous", "redundant"],
    ["unnecessary", "redundant"],
    ["unuseds", "unused"],
    ["useless", "redundant"],
    ["var", "variable"],
    ["variables", "variable"],
    ["vars", "variable"],
    ["vertices", "vertex"],
]);

export const STOP_WORDS: ReadonlySet<string> = new Set(
    "should not be in no to of with ensure is use used using the for that or check checks and on have set without a an when if this these are as by from must can will would may do does did all any avoid avoids avoided prefer prefers disallow disallowed require requires enforce enforced considered its has had was were than then else such each both only more most other per via at new old make get gets got detect detects find finds found report reports allow allows allowed potential possible possibly recommend recommended correct proper properly instead rather define defined contains contain containing name names named title track matching enabled disabled feature flag option value values which while into out within about against before after over under up down off but so too very just like etc there here where what how why non pre self given need needs it we you your our their them they rule rules ckv cwe sast dast good bad removed comply passed lint linter uses non av".split(
        " ",
    ),
);

export const ES_PLURAL_SUFFIXES: readonly string[] = ["ches", "shes", "sses", "xes", "zes"];

export const S_KEEP_SUFFIXES: readonly string[] = ["ss", "us", "is", "os"];