Rules
1183 rules for six languages. A project picks a tier in tx0.toml, and each tier includes the ones before it: default has 353 rules, recommended adds 401, strict adds 426, and all runs every rule. Any rule can also be turned on by its id.
A rule is on by default only when its precision has been measured on code its authors had not seen. tx0 explain RULE shows any rule in the terminal.
Go rules 199, 70 of them in default
-
tx0/go:address-compared-with-nildefaultThe address of a value is compared with nil, which it never is
-
tx0/go:always-true-inequalitydefaultA value is tested to differ from one constant or another, which every value does
-
tx0/go:append-nothingdefaultappendis called with a slice and nothing to append -
tx0/go:atomic-result-assigneddefaultThe result of an atomic add is assigned back to the variable it updated, which is not atomic
-
tx0/go:benchmark-n-assigneddefaultA benchmark changes
b.N, which the testing package sets and divides by -
tx0/go:bidi-control-characterdefaultThe source contains a character that reorders how text is displayed, so code reads differently than it runs
-
tx0/go:compare-new-errordefaultAn error is compared with a newly made one, which never equals it
-
tx0/go:decimal-file-modedefaultA file mode is written as a decimal number that reads like octal, such as
644 -
tx0/go:defer-before-error-checkdefaultA call on a result is deferred before the error of the call is checked
-
tx0/go:defer-evaluates-nowdefaultA deferred call is given an elapsed time, which is measured when
deferruns rather than at the end -
tx0/go:discarded-query-editdefaultThe query of a URL is changed on a parsed copy that is then dropped
-
tx0/go:discarded-resultdefaultA function that only computes a value is called and its value is thrown away
-
tx0/go:double-lockdefaultA mutex is locked again by the code that holds it, which blocks forever
-
tx0/go:double-negationdefaultA boolean is negated twice
-
tx0/go:duplicate-casedefaultA case of a switch repeats an earlier one
-
tx0/go:duplicate-conditiondefaultA condition of an if-else chain repeats an earlier one
-
tx0/go:empty-error-checkdefaultAn error is checked but not handled
-
tx0/go:errors-as-targetdefaulterrors.Asis given a target that is nil or not a pointer, and panics -
tx0/go:fatal-in-goroutinedefaultA test is stopped with
Fatal,FailNoworSkipfrom a goroutine it started -
tx0/go:find-all-count-zerodefaultA
FindAllmethod of a regular expression is asked for at most zero matches -
tx0/go:foreign-time-layoutdefaultA time layout is written with placeholders such as
YYYYthat Go'stimepackage takes literally -
tx0/go:function-compared-with-nildefaultA declared function is compared with
nil, which it never is -
tx0/go:identical-argumentsdefaultA function that compares or replaces is given the same expression twice
-
tx0/go:identical-branchesdefaultEvery branch of an if-else is the same
-
tx0/go:identical-operandsdefaultBoth operands of an operator are the same
-
tx0/go:impossible-conjunctiondefaultA condition requires one value to meet two comparisons that no value meets together
-
tx0/go:impossible-sign-checkdefaultA length or an unsigned number is compared with zero in a way that is always true or always false
-
tx0/go:index-at-lengthdefaultA slice, array or string is indexed at its length, which is always out of range
-
tx0/go:ineffective-recoverdefaultrecoveris called where it always returns nil and stops no panic -
tx0/go:invalid-regexpdefaultA constant regular expression is not valid in Go's syntax
-
tx0/go:invalid-strconv-sizedefaultA
strconvfunction is given a base or bit size it does not accept -
tx0/go:loop-condition-unchangeddefaultNothing in a loop changes its condition and nothing leaves it, so it never ends once entered
-
tx0/go:loop-variable-addressdefaultThe address of a range variable is kept beyond its iteration, before Go 1.22, so all copies point to one variable
-
tx0/go:loop-variable-captureddefaultA goroutine or deferred function reads a loop variable that later iterations change, before Go 1.22
-
tx0/go:lost-canceldefaultThe cancel function of a derived context is discarded
-
tx0/go:malformed-test-namedefaultA test function is named so that
go testnever runs it -
tx0/go:misdeclared-standard-methoddefaultA method has the name of a standard interface's method but another signature, so it is not used
-
tx0/go:mismatched-unlockdefaultA lock is followed by a deferred call that locks again or releases the other kind of lock
-
tx0/go:misplaced-build-constraintdefaultA build constraint comes after the package clause, where the go tool ignores it
-
tx0/go:modulo-onedefaultA remainder is taken of a division by 1, which is always 0
-
tx0/go:nan-comparisondefaultA number is compared with
math.NaN(), which gives the same result for every number -
tx0/go:negative-zero-literaldefault-0.0is written for negative zero, but the constant is positive zero -
tx0/go:nil-contextdefaultnilis passed as the parent context to a function ofcontext, which panics -
tx0/go:old-tls-versiondefaultA TLS configuration allows SSL 3.0, TLS 1.0 or TLS 1.1
-
tx0/go:printfdefaultA format and its arguments do not match
-
tx0/go:random-range-onedefaultA random number is drawn below 1, which always gives 0
-
tx0/go:recursive-string-methoddefaultA
StringorErrormethod formats its own receiver withfmt, which calls the method again -
tx0/go:reflect-value-equalitydefaultTwo
reflect.Values are compared with==, which compares their internals rather than the values they hold -
tx0/go:replace-count-zerodefaultstrings.Replaceorbytes.Replaceis told to make no replacements -
tx0/go:return-nil-errordefaultAn error variable is returned in the branch where it was just found to be nil
-
tx0/go:self-assignmentdefaultA value is assigned to itself
-
tx0/go:shadowed-assertion-elsedefaultThe
elsebranch of a type assertion uses the new variable, which holds a zero value there -
tx0/go:sleep-without-unitdefaulttime.Sleepis given a small number without a unit, which counts nanoseconds -
tx0/go:slog-unpaired-argumentdefaultA structured log call is given a key without a value
-
tx0/go:small-rsa-keydefaultAn RSA key is generated with fewer than 2048 bits
-
tx0/go:spaced-directivedefaultA
go:directive has a space after the slashes, which turns it into a plain comment -
tx0/go:split-count-zerodefaultstrings.SplitNorbytes.SplitNis asked for zero parts and returns nil -
tx0/go:string-of-intdefaultAn integer is converted to a string, which makes a character rather than its digits
-
tx0/go:struct-tagdefaultA struct tag is malformed or its fields' names conflict
-
tx0/go:swapped-assign-operatordefault=+,=-or=!is written where+=,-=or!=was likely meant -
tx0/go:trim-cutset-repeatsdefaultThe set of characters given to
Trim,TrimLeftorTrimRightrepeats a character, as a prefix or suffix would -
tx0/go:unbuffered-signal-channeldefaultsignal.Notifyis given a channel without a buffer, so signals that arrive while nobody receives are lost -
tx0/go:uncatchable-signaldefaultA program asks to handle
SIGKILLorSIGSTOP, which never reach it -
tx0/go:unconditional-recursiondefaultA function calls itself before anything could stop it, so it recurses until the stack overflows
-
tx0/go:unmarshal-non-pointerdefaultData is decoded into a value that is not a pointer, which cannot receive it
-
tx0/go:unreachable-codedefaultCode that can never run
-
tx0/go:use-after-closedefaultA channel is sent to or closed again after it was closed
-
tx0/go:waitgroup-add-in-goroutinedefaultWaitGroup.Addis called inside the goroutine it counts -
tx0/go:wrong-loop-directiondefaultA loop steps its counter away from the bound of its condition
-
tx0/go:wrong-loop-variabledefaultA loop tests one variable and steps another
-
tx0/go:append-after-make-lengthrecommendedA slice made with a length is appended to, so the values follow that many zero elements
-
tx0/go:archive-entry-pathrecommendedThe name of an archive entry is joined to a directory without checking that it stays inside
-
tx0/go:busy-waitrecommendedA loop spins on the processor while it waits, with an empty body or a
selectwhosedefaultdoes nothing -
tx0/go:cancel-not-called-on-pathrecommendedThe cancel function of a derived context is not called on a path to a
return -
tx0/go:constant-conditionrecommendedAn
iftests the constanttrueorfalse, so one of its branches never runs -
tx0/go:constant-ivrecommendedData is encrypted with an initialization vector or nonce that is the same every time
-
tx0/go:constant-saltrecommendedA password is hashed with a salt written into the program, the same for every password
-
tx0/go:context-key-basic-typerecommendedA context value is stored under a key of a predeclared type, which other packages can collide with
-
tx0/go:copied-lockrecommendedA value that contains a lock is copied
-
tx0/go:dead-storerecommendedA value is assigned to a local variable and replaced or dropped before anything reads it
-
tx0/go:deep-nestingrecommendedControl statements are nested deeper than the configured maximum
-
tx0/go:defer-in-looprecommendedA
deferinside a loop runs only when the function returns -
tx0/go:duplicate-importrecommendedA file imports the same package twice under different names
-
tx0/go:empty-critical-sectionrecommendedA lock is released right after it is taken, protecting nothing
-
tx0/go:error-text-comparisonrecommendedAn error is identified by comparing its message with a constant string
-
tx0/go:exit-skips-deferrecommendedThe program exits from a function after a
defer, so the deferred call never runs -
tx0/go:file-not-closedrecommendedA file is opened and never closed
-
tx0/go:fixed-temp-pathrecommendedA file is created under a fixed name in a shared temporary directory
-
tx0/go:fresh-context-with-parameterrecommendedA function that is given a context starts a new one with
context.Background()orcontext.TODO() -
tx0/go:goroutine-dump-in-responserecommendedA stack trace is written into an HTTP response
-
tx0/go:goroutine-stuck-sendingrecommendedA goroutine sends its result on an unbuffered channel that the function may stop waiting for, and then blocks forever
-
tx0/go:high-complexityrecommendedA function has more independent paths through it than the configured maximum
-
tx0/go:http-error-without-returnrecommendedA handler writes an error response and then carries on as if the request had succeeded
-
tx0/go:ignored-errorrecommendedThe error of a standard library call that changes files, the environment or a value is dropped
-
tx0/go:insecure-cipher-suiterecommendedA TLS configuration names a cipher suite that is known to be insecure
-
tx0/go:jwt-unverifiedrecommendedA JSON Web Token is read without checking its signature, or may be unsigned
-
tx0/go:lock-held-on-returnrecommendedA mutex that the function unlocks elsewhere is still locked on a path to a
return -
tx0/go:long-functionrecommendedA function has more lines of code than the configured maximum
-
tx0/go:long-parameter-listrecommendedA function takes more parameters than the configured maximum
-
tx0/go:loop-runs-oncerecommendedA counting or conditional loop always leaves at the end of its first iteration
-
tx0/go:nil-check-after-userecommendedA pointer is compared with nil after a field was already read or written through it
-
tx0/go:nil-dereferencerecommendedA nil pointer, map or slice is used in a way that panics
-
tx0/go:open-redirectrecommendedA handler redirects to a location taken from the request without a check
-
tx0/go:overwritten-parameterrecommendedA parameter is assigned before its value is read, so the argument is ignored
-
tx0/go:password-fast-hashrecommendedA password is hashed with a fast general-purpose hash instead of a password hashing function
-
tx0/go:predictable-random-secretrecommendedA token, key, password or salt is made from
math/rand, whose output can be predicted -
tx0/go:regexp-in-looprecommendedA constant regular expression is compiled on every iteration of a loop
-
tx0/go:request-chosen-memberrecommendedA method or field is chosen by reflection with a name taken from an HTTP request
-
tx0/go:request-path-in-file-accessrecommendedA file is opened, written or removed at a path taken from an HTTP request without a check
-
tx0/go:request-url-fetchedrecommendedA server sends a request to an address taken from an incoming request without a check
-
tx0/go:request-value-in-commandrecommendedA program is run with a name or argument taken from an HTTP request without a check
-
tx0/go:request-value-in-environmentrecommendedAn environment variable of the process is set from an HTTP request
-
tx0/go:resource-open-on-returnrecommendedA file or connection that the function closes elsewhere is left open on a path to a
return -
tx0/go:response-body-not-closedrecommendedThe body of an HTTP response is never closed, which keeps its connection from being reused
-
tx0/go:rows-error-uncheckedrecommendedRows of a database query or lines of a scanner are read in a loop whose ending error is never checked
-
tx0/go:rows-not-closedrecommendedThe rows of a database query are never closed, which holds on to the connection
-
tx0/go:secret-in-literalrecommendedA private key or a service token is written into a string literal
-
tx0/go:sentinel-error-equalityrecommendedAn error is compared with
==to a standard sentinel error that is usually wrapped -
tx0/go:server-without-timeoutsrecommendedAn HTTP server is started without a timeout for reading requests
-
tx0/go:shell-command-builtrecommendedA command line built at run time is handed to a shell
-
tx0/go:sql-built-from-stringsrecommendedAn SQL statement passed to a query method is pieced together from strings at run time
-
tx0/go:ssh-host-key-ignoredrecommendedAn SSH client accepts any host key, so it cannot tell the server from an impostor
-
tx0/go:stat-then-createrecommendedA file is created after a separate check that it does not exist, leaving a gap for a race
-
tx0/go:strings-index-gt-zerorecommendedThe result of
strings.Indexis compared with> 0, which misses a match at the start -
tx0/go:tick-leakrecommendedtime.Tickis called in a function that returns, which leaks its ticker before Go 1.23 -
tx0/go:tls-verification-disabledrecommendedA TLS configuration turns off the verification of the server's certificate
-
tx0/go:transaction-not-rolled-backrecommendedA database transaction is started in a function that never rolls it back
-
tx0/go:unbounded-decompressionrecommendedEverything a decompressing reader produces is copied without a limit
-
tx0/go:unchecked-close-writerecommendedThe error of closing a file that was written is lost in a
defer -
tx0/go:unescaped-template-contentrecommendedA value computed at run time is marked as safe HTML, JavaScript or URL content for
html/template -
tx0/go:unread-errorrecommendedAn error returned by a call is stored in a variable and overwritten or dropped before anything reads it
-
tx0/go:weak-cipherrecommendedData is encrypted with DES, triple DES or RC4, which are broken or too weak
-
tx0/go:world-writable-filerecommendedThe mode of a file is changed to one that lets every user write to it
-
tx0/go:writer-not-flushedrecommendedA buffering or compressing writer is never flushed or closed, so its last bytes are lost
-
tx0/go:blank-range-variablestrictA
rangeclause names a blank variable that can be left out -
tx0/go:bool-literal-comparisonstrictA value is compared with
trueorfalse -
tx0/go:buffer-conversionstrictThe content of a buffer is converted between string and bytes instead of read in the wanted form
-
tx0/go:command-from-pathstrictA program is started by a bare name, so the directories of
PATHdecide which one runs -
tx0/go:compare-for-equalitystrictThe three-way
Compareofstringsorbytesis used only to test equality -
tx0/go:complex-conditionstrictA boolean expression chains more
&&and||operators than the configured maximum -
tx0/go:context-fieldstrictA struct type keeps a
context.Contextin a field -
tx0/go:context-not-firststrictA function takes a
context.Contextafter other parameters -
tx0/go:cookie-without-protectionstrictA cookie is made without
Secureor withoutHttpOnly -
tx0/go:deprecated-standard-apistrictA member of the standard library that its documentation marks as deprecated is used
-
tx0/go:else-after-returnstrictAn
elsefollows a branch that always returns, so its body could follow theifunindented -
tx0/go:empty-branchstrictA branch of an
iforelseis empty and has no comment -
tx0/go:empty-commentstrictA block comment has no text
-
tx0/go:empty-functionstrictA function has an empty body without a comment that says why
-
tx0/go:error-message-stylestrictAn error message starts with a capital letter or ends with punctuation or a newline
-
tx0/go:error-not-wrappedstrictfmt.Errorfprints an error with%vor%s, so callers cannot unwrap it -
tx0/go:errorf-without-argumentsstrictfmt.Errorfis called with a constant message and nothing to format -
tx0/go:errors-new-sprintfstricterrors.New(fmt.Sprintf(...))can be written asfmt.Errorf(...) -
tx0/go:for-truestrictA loop has the condition
true, which it needs not -
tx0/go:hardcoded-credentialstrictA password, secret or token is written into the source as a string literal
-
tx0/go:hardcoded-ip-addressstrictAn IP address is written into the source as a string literal
-
tx0/go:http-status-literalstrictAn HTTP status is written as a number instead of the constant
net/httpdefines for it -
tx0/go:identical-functionsstrictTwo functions of a file have the same parameters, results and body
-
tx0/go:if-init-only-in-conditionstrictThe init statement of an
ifnames a value that only its condition reads -
tx0/go:index-for-containsstrictThe result of
Indexis compared with -1 or 0 only to learn whether a text contains another -
tx0/go:large-switchstrictA switch has more cases than the configured maximum
-
tx0/go:legacy-octal-literalstrictAn octal number is written with a leading
0instead of the0oprefix -
tx0/go:listen-all-interfacesstrictA server listens on the unspecified address, which accepts connections on every interface
-
tx0/go:long-case-clausestrictA case of a switch has more lines of code than the configured maximum
-
tx0/go:long-filestrictA file has more lines of code than the configured maximum
-
tx0/go:long-linestrictA line is longer than the configured maximum
-
tx0/go:mergeable-casesstrictAdjacent cases of a switch have the same body
-
tx0/go:negated-equalitystrictAn equality test is negated with
!instead of using the opposite operator -
tx0/go:nested-anonymous-structstrictAnonymous struct types are nested three levels deep
-
tx0/go:nesting-weighted-complexitystrictA function's branches, weighted by how deeply they are nested, exceed the configured maximum
-
tx0/go:parenthesized-conditionstrictThe condition of an
if,fororswitchis wrapped in parentheses that Go does not need -
tx0/go:print-of-sprintfstrictA string formatted with
fmt.Sprintfis printed right away instead of formatting while printing -
tx0/go:profiling-endpoint-importstrictnet/http/pprofis imported for its side effect, which adds profiling endpoints to the default server -
tx0/go:receiver-name-mismatchstrictMethods of one type name their receiver differently, or call it
thisorself -
tx0/go:redundant-breakstrictA
breakends a case that would end anyway -
tx0/go:redundant-make-capacitystrictmakeis given a capacity or buffer size that is the default anyway -
tx0/go:redundant-returnstrictA function without results ends with a bare
return, which it would do anyway -
tx0/go:repeated-string-literalstrictThe same string literal is written more times than the configured maximum in one file
-
tx0/go:request-value-loggedstrictA value taken from an HTTP request is written to a text log as it is
-
tx0/go:rsa-pkcs1v15-encryptionstrictData is encrypted with RSA and PKCS #1 v1.5 padding, which leaks the plaintext to padding queries
-
tx0/go:scattered-importsstrictA file has more than one import declaration
-
tx0/go:semicolon-joined-statementsstrictTwo statements are written on one line, separated by a semicolon
-
tx0/go:shadowed-builtinstrictA declaration reuses the name of a predeclared function or type such as
len,copyorstring -
tx0/go:single-case-selectstrictA
selecthas a single case and nodefault, so it is a plain send or receive -
tx0/go:single-method-interface-namestrictAn interface with a single method is not named after the method with
-er -
tx0/go:slice-to-lengthstrictA slice expression gives the length as its upper bound, which is the default
-
tx0/go:stray-semicolonstrictA statement or declaration ends in a semicolon that Go inserts by itself
-
tx0/go:switch-in-casestrictA switch is written inside a case of another switch
-
tx0/go:task-commentstrictA comment marks work still to be done with
TODO,FIXME,XXXorHACK -
tx0/go:time-sub-nowstrictA difference with
time.Now()can be written withtime.Sinceortime.Until -
tx0/go:too-many-returnsstrictA function has more
returnstatements than the configured maximum -
tx0/go:underscore-namestrictA function or local variable is named with underscores instead of mixed caps
-
tx0/go:undocumented-blank-importstrictA package is imported only for its side effects without a comment that says why
-
tx0/go:unencrypted-requeststrictA request is sent to a fixed URL over an unencrypted protocol
-
tx0/go:ungrouped-parametersstrictAdjacent parameters of the same type each repeat the type instead of sharing it
-
tx0/go:weak-hashstrictMD5 or SHA-1 is used, whose collisions can be produced at will
-
tx0/go:yoda-conditionstrictA comparison puts the constant before the value it tests
-
tx0/go:else-if-without-elseallAn if-else-if chain has no final
elsefor the case where no condition holds -
tx0/go:missing-license-headerallA file has no copyright or license notice before its package clause
-
tx0/go:switch-without-defaultallA switch has no
defaultcase for values that no case lists
Python rules 230, 69 of them in default
-
tx0/python:assert-always-truedefaultAn assertion tests a non-empty string or display, which is always true
-
tx0/python:assert-tupledefaultAn assertion tests a tuple, which is always true
-
tx0/python:call-arguments-mismatchdefaultA call does not fit the parameters of a function defined in the same file
-
tx0/python:callback-arity-mismatchdefaultA lambda takes a different number of arguments than the builtin calls it with
-
tx0/python:command-string-without-shelldefaultsubprocessgets a command line as one string withoutshell=True -
tx0/python:comprehension-key-never-variesdefaultA dict comprehension uses the same literal key for every element
-
tx0/python:coroutine-not-awaiteddefaultA coroutine is created by a call and dropped without being awaited
-
tx0/python:dataclass-mutable-defaultdefaultA dataclass field defaults to a list, dict or set, and defining the class raises
ValueError -
tx0/python:datetime-out-of-rangedefaultA date or time is built from a literal field outside its range
-
tx0/python:decimal-file-modedefaultFile permissions are written in decimal where octal was meant
-
tx0/python:decorator-orderdefaultA method's decorators are stacked in an order that fails or no longer works
-
tx0/python:defaultdict-factory-keyworddefaultdefaultdictgets its factory asdefault_factory=, which becomes a dict entry -
tx0/python:discarded-resultdefaultThe result of a call that has no other effect is dropped
-
tx0/python:duplicate-base-classdefaultA class lists the same base twice
-
tx0/python:duplicate-conditiondefaultA condition of an if-elif chain repeats an earlier one
-
tx0/python:duplicate-dict-keydefaultA dict display gives the same key twice
-
tx0/python:duplicate-set-itemdefaultA set display lists the same member twice
-
tx0/python:empty-membershipdefaultA value is looked up with
inin an empty display -
tx0/python:enum-with-generated-methodsdefaultGenerated
__init__,__eq__and__repr__replace those of anEnumsubclass -
tx0/python:environ-copy-still-livedefaultcopy.copy(os.environ)makes an object that still changes the real environment -
tx0/python:except-joined-typesdefaultA handler's types are joined with
ororand, so one class is matched -
tx0/python:except-shadoweddefaultAn exception type is already caught by an earlier
exceptclause -
tx0/python:finally-control-flowdefaultA
finallyblock jumps away withreturn,breakorcontinueand drops any pending exception -
tx0/python:format-call-mismatchdefaultA literal
str.formattemplate and its arguments do not fit together -
tx0/python:identical-operandsdefaultBoth operands of an operator are the same
-
tx0/python:incompatible-literal-operandsdefaultAn operator combines two literals of types that do not support it
-
tx0/python:invalid-escapedefaultA backslash in a string starts no escape sequence
-
tx0/python:invalid-regexdefaultA literal regular expression or replacement is one that
rerefuses -
tx0/python:is-literaldefaultisoris notcompares with a literal -
tx0/python:isinstance-bad-classdefaultisinstanceorissubclassis given something other than classes to check against -
tx0/python:iter-method-returns-collectiondefault__iter__returns a collection or literal, which is not an iterator -
tx0/python:join-non-stringsdefaultstr.joinis given literals that are not strings -
tx0/python:length-sign-testdefaultThe result of
lenis tested for being negative, which it never is -
tx0/python:literal-misusedefaultA literal is called, searched with
inor indexed, which its type does not support -
tx0/python:logging-format-mismatchdefaultA logging call's
%format and its arguments do not fit together -
tx0/python:mock-check-without-assertdefaultA mock check such as
called_once_withis written withoutassert_, so it checks nothing -
tx0/python:modified-while-iteratingdefaultA loop adds to or removes from the collection it is walking
-
tx0/python:nan-equalitydefaultA value is compared with NaN using
==or!= -
tx0/python:nested-event-loopdefaultasyncio.runis called inside a coroutine, where a loop is already running -
tx0/python:non-string-environ-valuedefaultA value other than a string is assigned to
os.environ -
tx0/python:not-an-exceptiondefaultA value that is not an exception is raised, caught or given as a cause
-
tx0/python:not-implemented-truthdefaultThe truth value of
NotImplementedis taken -
tx0/python:open-modedefaultA file is opened with a mode or arguments that
openrefuses -
tx0/python:percent-formatdefaultA
%format and its values do not match -
tx0/python:print-redirectdefaultprint >> fileis written as in Python 2 -
tx0/python:property-accessor-aritydefaultA property accessor takes the wrong arguments, or its getter returns nothing
-
tx0/python:pytz-tzinfo-argumentdefaultA
pytztime zone is passed astzinfo, which gives a wrong offset -
tx0/python:raise-not-implementeddefaultNotImplementedis raised instead ofNotImplementedError -
tx0/python:raises-context-unuseddefaultpytest.raisesis called as a statement, so it checks nothing -
tx0/python:redefined-functiondefaultA function or class is defined again before the first definition is used
-
tx0/python:regex-case-range-gapdefaultA character class of a regular expression has the range
A-z, which also takes in six punctuation characters -
tx0/python:regex-flag-as-countdefaultAn
reflag is passed wherere.suborre.splittake a count -
tx0/python:removed-numpy-aliasdefaultA NumPy alias of a builtin type that NumPy 1.24 removed is used
-
tx0/python:removed-unittest-aliasdefaultA test calls an old alias of a
unittestassertion, such asassertEquals, which Python 3.12 removed -
tx0/python:return-in-initdefault__init__hands back a value, and creating the object raisesTypeError -
tx0/python:self-assignmentdefaultAn assignment stores a name's value back into the same name
-
tx0/python:slots-conflictdefaultA name in
__slots__is also a class attribute, and defining the class raisesValueError -
tx0/python:special-method-aritydefaultA special method takes a different number of arguments than Python passes it
-
tx0/python:star-handler-group-typedefaultA star handler is written for a whole exception group type
-
tx0/python:stop-iteration-in-generatordefaultA generator raises
StopIteration, which Python turns intoRuntimeError -
tx0/python:swapped-augmented-operatordefault=+,=-or=~is written where an augmented assignment was likely meant -
tx0/python:tempfile-mktempdefaulttempfile.mktempreturns a name another process can take first -
tx0/python:type-variable-name-mismatchdefaultA
TypeVar,ParamSpec,TypeVarTupleorNewTypeis given a name that differs from the variable it is assigned to -
tx0/python:typevar-two-variancesdefaultA type variable is declared with both variance flags set
-
tx0/python:unhashable-literaldefaultA list, dict or set is written as a dict key or set member
-
tx0/python:unparsable-number-literaldefaultintorfloatis given a string literal it cannot read as a number -
tx0/python:unraised-exceptiondefaultAn exception object is built as a statement of its own and thrown away
-
tx0/python:unreachable-codedefaultCode that can never run
-
tx0/python:bare-exceptrecommendedexcept:without a type also catchesKeyboardInterruptandSystemExit -
tx0/python:bare-raise-in-finallyrecommendedA bare
raisestands in afinallyblock, which also runs without an exception -
tx0/python:blocking-call-in-asyncrecommendedAn
asyncfunction makes a call that blocks the event loop -
tx0/python:cached-methodrecommendedA method is cached with
functools.lru_cacheorcache, which keeps every instance alive -
tx0/python:class-attribute-redefinedrecommendedA class body assigns the same attribute twice
-
tx0/python:class-skips-exception-baserecommendedA class derives from
BaseExceptiondirectly, soexcept Exceptionmisses it -
tx0/python:constant-ivrecommendedData is encrypted with an initialization vector or nonce written in the source
-
tx0/python:constant-saltrecommendedA password is hashed with a salt written in the source
-
tx0/python:cors-any-originrecommendedCross-origin requests are allowed from every origin
-
tx0/python:csrf-check-offrecommendedProtection against cross-site request forgery is turned off for a view or an application
-
tx0/python:cyclomatic-complexityrecommendedA function has more independent paths than the limit
-
tx0/python:debugger-callrecommendedA call stops the program in a debugger
-
tx0/python:deprecated-logger-warnrecommendedwarnis called on a logger, an old alias ofwarningthat is deprecated -
tx0/python:django-debug-settingrecommendedA Django settings module turns
DEBUGon, or allows every host name -
tx0/python:django-form-all-fieldsrecommendedA Django model form or serializer exposes every model field with
__all__orexclude -
tx0/python:dunder-all-entryrecommendedAn entry of
__all__is not a string, or names nothing the module defines -
tx0/python:duplicate-importrecommendedThe same module or name is imported twice in one scope
-
tx0/python:duplicate-parametrize-caserecommendedpytest.mark.parametrizelists the same case twice -
tx0/python:eval-execrecommendedevalorexecruns code that is not a literal -
tx0/python:exact-type-testrecommendedThe type of a value is compared with
==or!= -
tx0/python:file-not-closedrecommendedA file is opened and used in one expression, so nothing closes it
-
tx0/python:fixed-truth-conditionrecommendedAn
ifor ternary tests a literal, so the same branch runs every time -
tx0/python:flask-debugrecommendedA Flask application is run in debug mode
-
tx0/python:hardcoded-passwordrecommendedA password or secret key is written in the source
-
tx0/python:identical-branchesrecommendedEvery branch of an if-else or conditional expression is the same
-
tx0/python:implicit-concatenationrecommendedTwo string literals on one line are joined into one item of a list or call
-
tx0/python:insecure-randomrecommendedA token, password or key is made with the predictable
randommodule -
tx0/python:isclose-without-abs-tolrecommendedmath.isclosecompares with zero withoutabs_tol, so only exact zero passes -
tx0/python:loop-else-without-breakrecommendedA loop has an
elseblock but nobreak, so the block runs like code after the loop -
tx0/python:loop-runs-oncerecommendedA loop's body always leaves the loop, so it runs at most once
-
tx0/python:loop-variable-closurerecommendedA lambda stored in a loop reads the loop variable when called, not when made
-
tx0/python:lxml-entity-expansionrecommendedXML is parsed with
lxmlin a way that expands entities from the document -
tx0/python:mark-safe-formattedrecommendedmark_safeis given a string built by formatting, so the values put into it are not escaped -
tx0/python:method-without-selfrecommendedA method has no parameter to receive the instance or class
-
tx0/python:mutable-default-argumentrecommendedA parameter's default is a list, dict or set shared by all calls
-
tx0/python:naive-utc-datetimerecommendeddatetime.utcnoworutcfromtimestampmakes a UTC time without a time zone -
tx0/python:nested-loop-reuses-variablerecommendedAn inner
forloop assigns the variable of an outer one -
tx0/python:nesting-depthrecommendedControl statements are nested deeper than the limit
-
tx0/python:operator-raises-not-implementedrecommendedAn operator method raises
NotImplementedErrorwhere returningNotImplementedlets the other operand try -
tx0/python:os-systemrecommendedos.systemoros.popenruns a command built at run time -
tx0/python:pytest-yield-fixturerecommendedA fixture is declared with
pytest.yield_fixture, an alias that pytest deprecated and removed -
tx0/python:regex-duplicate-class-memberrecommendedA bracket set in a pattern names the same character twice
-
tx0/python:regex-empty-alternativerecommended||or a|at either end of a pattern adds a choice that matches nothing at all -
tx0/python:regex-empty-grouprecommendedA pattern has parentheses with nothing between them
-
tx0/python:removed-stdlib-apirecommendedA module or function that the standard library removed in Python 3.11 to 3.13 is used
-
tx0/python:request-without-timeoutrecommendedAn HTTP request with
requestshas no timeout -
tx0/python:silent-exception-handlerrecommendedAn
exceptclause forExceptionorBaseExceptiondoes nothing butpass -
tx0/python:sql-formattingrecommendedAn SQL query is built by formatting values into its text
-
tx0/python:ssh-unknown-host-acceptedrecommendedA
paramikoSSH client accepts servers whose host key it does not know -
tx0/python:subprocess-shellrecommendedA command built at run time is run through the shell
-
tx0/python:tangled-functionrecommendedA function's branches and loops, weighted by how deep they nest, exceed the configured limit
-
tx0/python:tar-extract-without-filterrecommendedA tar archive is extracted without a
filter, so its members can write outside the target directory -
tx0/python:task-reference-droppedrecommendedThe task
asyncio.create_taskreturns is not kept anywhere -
tx0/python:template-autoescape-offrecommendedA Jinja environment does not escape the values put into templates
-
tx0/python:tls-verify-disabledrecommendedThe certificate or host name of a TLS server is not checked
-
tx0/python:token-signature-ignoredrecommendedjwt.decodeis told to skip the signature check -
tx0/python:torch-load-unrestrictedrecommendedtorch.loadmay unpickle code from the file -
tx0/python:uncalled-private-methodrecommendedNothing calls a method whose name is mangled private
-
tx0/python:undefined-namerecommendedA name is used that the file never binds and that is not a builtin
-
tx0/python:unlisted-star-importrecommendedfrom module import *binds names that the file does not list -
tx0/python:unsafe-deserializationrecommendedData is read with
pickleor a format that can run code -
tx0/python:unused-importrecommendedAn imported name is never used
-
tx0/python:unused-variablerecommendedA local variable is assigned but never read
-
tx0/python:useless-reraiserecommendedEvery
exceptclause of atryraises the caught exception again unchanged -
tx0/python:weak-cipherrecommendedA broken cipher or the ECB mode encrypts data
-
tx0/python:weak-hashrecommendedMD5 or SHA-1 is used without
usedforsecurity=False -
tx0/python:weak-key-sizerecommendedAn RSA or DSA key is made shorter than 2048 bits
-
tx0/python:weak-tls-versionrecommendedAn SSL or early TLS version with known attacks is used
-
tx0/python:world-writable-moderecommendedA file's permissions let every user write it
-
tx0/python:write-only-private-fieldrecommendedA class assigns a private attribute
self.__namethat nothing reads -
tx0/python:yaml-unsafe-loadrecommendedYAML is read with a loader that can build any object
-
tx0/python:yield-without-finallyrecommendedA generator context manager's cleanup after
yieldis skipped when the block raises -
tx0/python:ambiguous-namestrictA variable, parameter, function or class is named
l,OorI -
tx0/python:any-annotationstrictA parameter or return value is annotated with
Any, which turns type checking off for it -
tx0/python:async-without-awaitstrictAn
asyncfunction never awaits anything -
tx0/python:bool-literal-comparisonstrictA value is compared with
TrueorFalseusing==or!= -
tx0/python:boolean-complexitystrictAn expression joins more conditions with
andandorthan the limit -
tx0/python:case-only-name-clashstrictTwo members of a class have names that are equal apart from upper and lower case
-
tx0/python:catch-all-error-thrownstrictraisethrows the root classExceptionorBaseExceptionitself -
tx0/python:class-attribute-name-stylestrictA name assigned in a class body follows neither the configured style nor
UPPER_CASE -
tx0/python:class-name-stylestrictThe name of a class does not follow the configured case style
-
tx0/python:collapsible-ifstrictAn
ifholds only anotherif, and the two conditions can be joined -
tx0/python:complex-classstrictThe methods of a class together have more paths than the configured limit
-
tx0/python:conditional-inside-conditionalstrictA ternary
x if c else yholds another ternary -
tx0/python:consecutive-appendsstrictSeveral
appendcalls on the same list follow each other, where oneextendor a display does the same -
tx0/python:cookie-without-flagsstrictA cookie is set without
secureor withouthttponly -
tx0/python:copying-comprehensionstrictA list or set comprehension only copies the items of an iterable
-
tx0/python:default-fixture-scopestrictA pytest fixture is given
scope="function", which is already the default -
tx0/python:disabled-code-commentstrictA comment holds code that was switched off
-
tx0/python:django-locals-contextstrictlocals()is passed as the context of a Django template -
tx0/python:django-model-without-strstrictA Django model defines no
__str__, so the admin and shell show it asModel object (1) -
tx0/python:django-nullable-text-fieldstrictA Django text field allows
NULL, so an empty value can be stored in two ways -
tx0/python:double-negationstrictnotor~is applied twice in a row -
tx0/python:duplicate-function-bodystrictTwo functions of a file have the same body
-
tx0/python:duplicate-string-literalstrictThe same string literal is written several times in one file
-
tx0/python:eager-log-formattingstrictA log message is formatted before the call, even when the level is turned off
-
tx0/python:empty-collection-callstrictdict(),list()ortuple()is called without arguments where a display is shorter -
tx0/python:eq-without-hashstrictA class defines
__eq__but not__hash__, so its instances cannot be put in sets or used as dict keys -
tx0/python:error-log-without-tracebackstrictAn
exceptblock logs witherror, which drops the traceback thatexceptionwould record -
tx0/python:exception-name-suffixstrictAn exception class's name does not end in
Error,ExceptionorWarning -
tx0/python:explicit-super-argumentsstrictsuperis given the class and instance that Python 3 fills in on its own -
tx0/python:file-lengthstrictA module has more lines of code than the limit
-
tx0/python:fstring-in-fstringstrictAn f-string is written inside a replacement field of another f-string
-
tx0/python:fstring-without-placeholdersstrictAn f-string has no replacement fields
-
tx0/python:function-lengthstrictA function exceeds the configured count of code lines
-
tx0/python:function-name-stylestrictThe name of a function does not follow the configured case style
-
tx0/python:global-statementstrictA function rebinds a module variable through
global -
tx0/python:hardcoded-ip-addressstrictAn IP address is written in the source
-
tx0/python:if-return-boolstrictAn
ifreturnsTruein one branch andFalsein the other, instead of returning the condition -
tx0/python:incomplete-orderingstrictA class defines some of
__lt__,__le__,__gt__and__ge__but not all, and is not markedtotal_ordering -
tx0/python:inconsistent-returnstrictA function returns a value on some paths and nothing on others
-
tx0/python:jump-at-block-endstrictA bare
returnends a function, orcontinueends a loop body, where control goes anyway -
tx0/python:lambda-assignmentstrictA lambda is assigned to a name where a
defwould give it that name -
tx0/python:late-module-importstrictA module-level import comes after other code
-
tx0/python:legacy-typing-genericstrictAn annotation uses
typing.List,Dictor another alias where the builtin type takes parameters -
tx0/python:legacy-union-syntaxstrictAn annotation uses
Optional[X]orUnion[X, Y]whereX | NoneandX | Ysay the same -
tx0/python:length-test-against-zerostrictThe length of a value is compared with zero where its truth value says the same
-
tx0/python:listen-on-any-addressstrictA socket or server is given the address
0.0.0.0or:: -
tx0/python:long-linestrictA line is wider than the configured number of characters
-
tx0/python:loop-yield-delegationstrictA
forloop only yields each item of an iterable, whichyield fromdoes directly -
tx0/python:many-instance-attributesstrictThe methods of a class assign more attributes of
selfthan the configured limit -
tx0/python:member-named-after-classstrictA method or attribute of a class has the class's own name
-
tx0/python:method-could-be-staticstrictA method never uses
self, so it does not need an instance -
tx0/python:method-name-stylestrictThe name of a method does not follow the configured case style
-
tx0/python:missing-final-newlinestrictA file does not end with a line break
-
tx0/python:missing-parameter-annotationstrictA parameter of a public function has no annotation
-
tx0/python:missing-return-annotationstrictA public function has no return annotation
-
tx0/python:module-name-stylestrictA file's name is not a lowercase module name
-
tx0/python:multiple-imports-per-linestrictOne
importstatement imports several modules -
tx0/python:multiple-statements-per-linestrictSeveral statements share one line, joined by
;or after the colon of a compound statement -
tx0/python:naive-datetime-nowstrictdatetime.now()ordatetime.today()makes a local time without a time zone -
tx0/python:needless-passstrictpassstands in a block that has other statements -
tx0/python:negated-comparisonstrictnotis applied to a comparison that has an operator for the opposite test -
tx0/python:none-comparisonstrictA value is compared with
Noneusing==or!= -
tx0/python:object-base-classstrictA class names
objectas its base, which every class already has -
tx0/python:open-without-encodingstrictA file is opened in text mode without an encoding, so it is read with the platform's default
-
tx0/python:parameter-name-stylestrictA parameter's name does not follow the configured case style
-
tx0/python:parenthesized-conditionstrictThe condition of
if,eliforwhile, or the value ofreturn, is wrapped in parentheses that do nothing -
tx0/python:regex-char-alternationstrictA group of a regular expression chooses between single characters with
| -
tx0/python:regex-plain-substitutionstrictre.subreplaces a pattern without special characters, whichstr.replacedoes without a regular expression -
tx0/python:regex-repeated-spacesstrictA pattern holds a run of spaces that is hard to count
-
tx0/python:regex-single-char-classstrictBrackets in a pattern wrap one letter or digit, which matches the same without them
-
tx0/python:regex-verbose-quantifierstrictA quantifier of a regular expression is written in a longer form than needed, or does nothing
-
tx0/python:repeated-prefix-teststrictstartswithorendswithis called several times on one value, joined withor -
tx0/python:shadowed-builtinstrictA variable hides a builtin of the same name
-
tx0/python:skip-without-reasonstrictA test is skipped or marked as an expected failure without a reason
-
tx0/python:subprocess-run-uncheckedstrictsubprocess.runis called withoutcheck, so a failing command goes unnoticed -
tx0/python:tab-indentationstrictA line is indented with tabs
-
tx0/python:todo-commentstrictA comment marks unfinished work with
TODO,FIXMEorXXX -
tx0/python:too-many-localsstrictA function binds more local variables than the configured limit
-
tx0/python:too-many-parametersstrictA function takes more parameters than the limit
-
tx0/python:too-many-returnsstrictA function has more
returnstatements than the limit -
tx0/python:undocumented-classstrictA public class has no docstring
-
tx0/python:undocumented-functionstrictA public function or method has no docstring
-
tx0/python:undocumented-modulestrictA module has no docstring
-
tx0/python:unencrypted-connectionstrictA connection is opened with FTP or Telnet, which encrypt nothing
-
tx0/python:vague-test-assertionstrictassertTrueorassertFalsetests a comparison that a specific assertion would report better -
tx0/python:variable-name-stylestrictA local variable's name does not follow the configured case style
-
tx0/python:wasteful-idiomstrictA builtin is used in a way that does more work than the result needs
-
tx0/python:whitespace-at-line-endstrictA line ends in spaces or tabs
-
tx0/python:zip-without-strictstrictzipis called on several iterables withoutstrict, so a length mismatch is silently cut off
JavaScript and TypeScript rules 259, 56 of them in default
-
tx0/ts:accessor-recursiondefaultA getter reads or a setter writes its own property, which recurses without end
-
tx0/ts:async-foreach-callbackdefaultAn async function passed to
forEachruns without anyone awaiting its promise -
tx0/ts:async-promise-executordefaultThe executor of a new promise is an async function
-
tx0/ts:bitwise-logicdefault|or&combines two boolean conditions where||or&&was meant -
tx0/ts:call-of-non-functiondefaultA literal is called, or
newis used with an arrow function, which throws -
tx0/ts:callback-over-holesdefaultAn array method's callback is never run on the empty slots of
Array(n) -
tx0/ts:case-with-logical-operatordefaultA
caselabel combines values with||,&&or,, so it matches only one of them -
tx0/ts:constant-binary-expressiondefaultAn operation has the same outcome whatever the values involved
-
tx0/ts:delete-variabledefaultdeleteis applied to a variable, which it cannot remove -
tx0/ts:derived-constructor-superdefaultA constructor uses
thisbeforesuper(...), omits it in a derived class or calls it without a parent -
tx0/ts:discarded-new-valuedefaultA method that returns a new string, number or array is called as a statement and its result is lost
-
tx0/ts:duplicate-casedefaultA case of a switch repeats an earlier one
-
tx0/ts:duplicate-class-memberdefaultA class defines a member twice
-
tx0/ts:duplicate-conditiondefaultA condition of an if-else chain repeats an earlier one
-
tx0/ts:duplicate-keydefaultAn object literal gives the same key twice
-
tx0/ts:duplicate-parameterdefaultA function has two parameters of the same name
-
tx0/ts:element-content-conflictdefaultA JSX element has children together with
dangerouslySetInnerHTML, or is a void element with children -
tx0/ts:empty-if-bodydefaultAn
iforelsebranch is a lone;, so the code after it runs unconditionally -
tx0/ts:getter-without-returndefaultA getter has no
return, so reading the property givesundefined -
tx0/ts:global-assigndefaultA built-in global is assigned another value
-
tx0/ts:identical-branchesdefaultEvery branch of an if-else or conditional expression is the same
-
tx0/ts:identical-operandsdefaultBoth operands of an operator are the same
-
tx0/ts:impossible-length-checkdefaultA length or size is tested for being at least 0, which always holds
-
tx0/ts:loop-update-mismatchdefaultA
forloop's update changes a variable that its condition does not read -
tx0/ts:loss-of-precisiondefaultA number literal has more precision than a double holds
-
tx0/ts:lost-incrementdefaultA variable is assigned its own postfix increment, so it keeps its old value
-
tx0/ts:membership-test-misusedefaultThe right side of
inorinstanceofis a value the operator cannot test against -
tx0/ts:namespace-object-calldefaultA built-in namespace object such as
MathorJSONis called like a function, which throws -
tx0/ts:nan-equality-testdefaultA value is compared with NaN, which equals nothing
-
tx0/ts:negative-zero-comparisondefaultA value is compared with
-0, which comparisons do not tell from0 -
tx0/ts:new-non-constructordefaultnewis applied toSymbolorBigInt, which throws -
tx0/ts:parse-int-radixdefaultparseIntis given a radix outside 2 to 36, so it always returns NaN -
tx0/ts:pattern-binds-nothingdefaultAn empty
{}or[]in a declaration binds no name -
tx0/ts:promise-as-conditiondefaultA condition tests the promise of an async call, which is always true
-
tx0/ts:promise-executor-returndefaultThe executor of a promise returns a value, which does not settle the promise
-
tx0/ts:read-only-assigndefaultA constant or an imported binding is assigned, which throws when it runs
-
tx0/ts:regex-never-matchesdefaultA pattern contains
[], a set that no character fits -
tx0/ts:regexp-bad-argumentdefaultRegExpis given a malformed pattern or unknown flags as literals, which throws -
tx0/ts:relational-chaindefaulta < b < ccompares the boolean result ofa < bwithc -
tx0/ts:repeated-jsx-attributedefaultA JSX element sets the same attribute twice, and the first value is ignored
-
tx0/ts:return-skips-catchdefaultA promise returned from a
tryblock withoutawaitescapes itscatchandfinally -
tx0/ts:self-assignmentdefaultA variable is assigned to itself
-
tx0/ts:self-importdefaultAn import names the file it is written in
-
tx0/ts:setter-value-discardeddefaultA value returned from a setter is discarded by every assignment
-
tx0/ts:swapped-assign-operatordefault=+,=-or=!is written where+=,-=or!=was likely meant -
tx0/ts:typeof-comparisondefaultThe result of
typeofis compared with a value it never has -
tx0/ts:unexpected-multilinedefaultA line starting with
(,[or a template continues the expression above -
tx0/ts:unreachable-codedefaultCode that can never run
-
tx0/ts:unread-private-memberdefaultA private field or method is never referenced inside its class
-
tx0/ts:unsafe-finallydefaultreturn,breakorcontinueleaves afinallyblock -
tx0/ts:unsafe-negationdefault!negates the left operand ofinorinstanceofinstead of the test -
tx0/ts:unsafe-optional-chainingdefaultA
?.chain ends whereundefinedthrows aTypeError -
tx0/ts:unthrown-errordefaultAn error is created and dropped instead of thrown
-
tx0/ts:use-before-declarationdefaultA
let,constor class is used before its declaration runs, which throws -
tx0/ts:useless-catchdefaultA
catchclause only throws the error it caught again -
tx0/ts:wrong-loop-directiondefaultA loop steps its counter away from the bound of its condition
-
tx0/ts:array-callback-returnrecommendedThe callback of an array method that uses its result never returns one
-
tx0/ts:arrow-bindrecommendedbindis called on an arrow function, whosethiscannot change -
tx0/ts:await-in-looprecommendedawaitinside a loop runs the iterations one after another -
tx0/ts:await-plain-valuerecommendedawaitis applied to a value that is never a promise -
tx0/ts:bang-after-optional-chainrecommended!claims that an optional chain, which may giveundefined, is set -
tx0/ts:bare-blockrecommendedA block stands inside another block without a reason
-
tx0/ts:boxed-primitiverecommendednew String,new Numberornew Booleancreates an object instead of a primitive -
tx0/ts:branch-countrecommendedA function has more decision points than the configured maximum
-
tx0/ts:broken-cipherrecommendedData is encrypted with DES, RC4, Blowfish or in ECB mode
-
tx0/ts:broken-hash-functionrecommendedA digest is computed with MD5, SHA-1 or another algorithm with known collisions
-
tx0/ts:builtin-prototype-changerecommendedThe prototype of a built-in such as
Arraygains or changes a member for the whole program -
tx0/ts:callback-thisrecommendedA function expression given to an array method uses
this, which isundefinedthere -
tx0/ts:case-countrecommendedA switch has more cases than the configured maximum
-
tx0/ts:case-scoped-declarationrecommendedA
let,const, function or class is declared directly in acaseand is visible in every other one -
tx0/ts:cipher-without-ivrecommendedcreateCipherderives key and IV from a password, without salt -
tx0/ts:cleartext-requestrecommendedA request is sent to an
http://orws://address -
tx0/ts:closure-over-loop-variablerecommendedA function created in a loop uses a
varcounter that the loop keeps changing -
tx0/ts:comment-in-jsx-textrecommendedText between JSX tags starts with
//or/*and is rendered instead of being a comment -
tx0/ts:cond-assignrecommendedA condition is an assignment, which may be a mistyped comparison
-
tx0/ts:conditional-hook-callrecommendedA React hook is called only on some renders, behind a condition, loop or early return
-
tx0/ts:constructor-adds-nothingrecommendedA constructor does only what the implicit one would
-
tx0/ts:cookie-without-http-onlyrecommendedA cookie is set with
httpOnlyturned off, so scripts can read it -
tx0/ts:cookie-without-securerecommendedA cookie is set without the
secureattribute -
tx0/ts:cors-any-originrecommendedThe CORS policy lets every website read the responses
-
tx0/ts:csp-unsafe-sourcerecommendedA content security policy allows inline script or
eval -
tx0/ts:declaration-reassignrecommendedThe name of a function or class declaration is assigned another value
-
tx0/ts:deep-function-nestingrecommendedFunctions are nested inside each other deeper than the configured maximum
-
tx0/ts:default-before-caserecommendedA
defaultclause is followed by acaseclause -
tx0/ts:dotfiles-servedrecommendedA static file server is told to serve files whose names start with a dot
-
tx0/ts:duplicate-import-sourcerecommendedTwo import declarations read the same module
-
tx0/ts:dynamic-scope-withrecommendedNames inside
with (obj)resolve against an object at run time -
tx0/ts:empty-blockrecommendedA block is empty
-
tx0/ts:empty-catchrecommendedA
catchblock ignores the error without saying why -
tx0/ts:empty-import-listrecommendedAn import or re-export declaration lists no names
-
tx0/ts:endless-looprecommendedA loop with an always-true condition has no
break,returnorthrow -
tx0/ts:enum-value-clashrecommendedTwo members of an enum have the same value, or the enum mixes numbers and strings
-
tx0/ts:eval-like-callrecommendedA string is run as code with
eval,Functionor a timer -
tx0/ts:extra-call-argumentsrecommendedA function of this file is called with more arguments than it has parameters
-
tx0/ts:fallthroughrecommendedA case of a switch runs on into the next without a comment saying so
-
tx0/ts:for-counter-changed-in-bodyrecommendedThe body of a for loop assigns the counter that its head steps
-
tx0/ts:foreach-result-usedrecommendedThe result of
forEach, which is alwaysundefined, is stored -
tx0/ts:generator-without-yieldrecommendedA generator function contains no
yield, so it produces no values -
tx0/ts:hardcoded-credentialrecommendedA password, API key or other secret is written into the source as a literal
-
tx0/ts:hostname-check-disabledrecommendedThe hostname check of a TLS connection is replaced by one that accepts every host
-
tx0/ts:html-string-sinkrecommendedA computed string is parsed as HTML through
innerHTML,insertAdjacentHTMLordocument.write -
tx0/ts:index-of-misuserecommendedindexOfis tested with> 0, which misses index 0, or searches for NaN, which it never finds -
tx0/ts:interface-constructor-methodrecommendedAn interface declares a method named
constructorwhere anewsignature was meant -
tx0/ts:jwt-none-algorithmrecommendedA JSON web token is issued or accepted unsigned, with the algorithm
none -
tx0/ts:label-on-non-looprecommendedA label marks a statement that is not a loop, switch or block
-
tx0/ts:leftover-debuggerrecommendedExecution pauses at a
debuggerkeyword left in the code -
tx0/ts:legacy-introspectionrecommendedCode reaches for
__proto__,arguments.calleeor another pre-standard property -
tx0/ts:legacy-module-keywordrecommendedA namespace is declared with the old keyword
module -
tx0/ts:legacy-octal-escaperecommendedA string uses a legacy octal escape or escapes a digit
-
tx0/ts:legacy-octal-numberrecommendedA number literal starts with
0and another digit, which reads as octal -
tx0/ts:legacy-ref-namerecommendedA JSX
refis given as a plain name in quotes, which current React ignores -
tx0/ts:list-item-without-keyrecommendedA JSX element rendered as part of a list has no
key -
tx0/ts:literal-widening-assertionrecommendedA literal is asserted with
asto the primitive type it already has -
tx0/ts:logical-operator-countrecommendedAn expression chains more
&&,||and??operators than the configured maximum -
tx0/ts:long-function-bodyrecommendedA function body spans more lines than the configured maximum
-
tx0/ts:loop-runs-oncerecommendedA loop's body always leaves the loop on its first pass
-
tx0/ts:message-origin-uncheckedrecommendedA window
messagehandler never reads where the event came from -
tx0/ts:needless-non-nullrecommendedA
!is applied to a value that can never benullorundefined -
tx0/ts:negated-equality-operandrecommended!a === bnegates the left operand instead of the comparison -
tx0/ts:nesting-depthrecommendedControl statements are nested deeper than the configured maximum
-
tx0/ts:nesting-weighted-complexityrecommendedA function's branches, weighted by how deeply they are nested, add up to more than the configured maximum
-
tx0/ts:parameter-countrecommendedA function takes more parameters than the configured maximum
-
tx0/ts:pattern-control-coderecommendedA pattern matches a control code below U+0020 other than tab or a line break
-
tx0/ts:pointless-final-jumprecommendedA
returnorcontinueat the end of its body changes nothing -
tx0/ts:post-message-any-originrecommendedpostMessagesends data to whatever origin the target window has, with"*" -
tx0/ts:predictable-secretrecommendedMath.randomproduces a value that is named as a token, password or other secret -
tx0/ts:private-key-literalrecommendedA string literal contains a PEM private key
-
tx0/ts:react-raw-htmlrecommendeddangerouslySetInnerHTMLis given markup that is not a literal -
tx0/ts:redundant-boolean-castrecommendedA value is converted to a boolean where it is tested as one already
-
tx0/ts:regex-anchor-scoperecommended^or$applies to one alternative of a regular expression while it looks meant for all -
tx0/ts:regex-empty-branchrecommendedA regular expression has an empty alternative or an empty capturing group
-
tx0/ts:regex-nested-repetitionrecommendedAn unbounded repetition in a regular expression contains another one, which can backtrack exponentially
-
tx0/ts:reject-with-non-errorrecommendedA literal is thrown or used to reject a promise, so it carries no stack trace
-
tx0/ts:rename-to-same-namerecommendedAn import, export or pattern spells out a rename whose target equals its source
-
tx0/ts:repeated-collection-elementrecommendedThe initial values of a
Setlist the same literal twice -
tx0/ts:repeated-type-memberrecommendedA union or intersection type lists the same type twice
-
tx0/ts:restricted-name-shadowedrecommendedA declaration hides
undefined,NaN,Infinity,evalorarguments -
tx0/ts:sanitizer-bypassrecommendedA computed value is marked as trusted, so Angular's sanitizer passes it through
-
tx0/ts:script-urlrecommendedA
javascript:URL runs its text as code when it is followed -
tx0/ts:security-header-disabledrecommendedA protective response header of helmet is turned off
-
tx0/ts:set-lists-character-twicerecommendedA
[...]set in a pattern lists one character twice -
tx0/ts:shell-command-stringrecommendedA command line built from values is run through a shell by
child_process -
tx0/ts:sparse-arrayrecommendedAn array literal has a hole between two elements
-
tx0/ts:sql-string-buildingrecommendedAn SQL statement is built from a template or concatenation with values
-
tx0/ts:state-write-without-renderrecommendedA class component writes
this.stateoutside the constructor, which does not render -
tx0/ts:tls-verification-disabledrecommendedCertificate verification of a TLS connection is turned off
-
tx0/ts:unawaited-async-callrecommendedThe promise of an async call inside an async function is dropped without
await -
tx0/ts:unused-importrecommendedAn imported name is never used in the file
-
tx0/ts:unused-localrecommendedA local variable, function or class is declared but never read
-
tx0/ts:useless-expressionrecommendedAn expression statement has no effect
-
tx0/ts:weak-key-sizerecommendedAn RSA or DSA key pair is generated with fewer than 2048 bits
-
tx0/ts:weak-tls-versionrecommendedA TLS connection allows SSL 3.0, TLS 1.0 or TLS 1.1
-
tx0/ts:world-writable-moderecommendedA file mode lets any user of the machine modify the file
-
tx0/ts:wrapper-type-annotationrecommendedA type is written as
String,Numberor another wrapper object instead of the primitive -
tx0/ts:xml-external-entitiesrecommendedAn XML parser is configured to expand external entities
-
tx0/ts:angle-bracket-assertionstrictA type assertion is written
<T>valueinstead ofvalue as T -
tx0/ts:anonymous-default-exportstrictThe default export is a function or class without a name
-
tx0/ts:apply-for-spreadstrict.applypasses an array of arguments where spread syntax would -
tx0/ts:arguments-objectstrictA function reads the
argumentsobject instead of a rest parameter -
tx0/ts:array-literal-candidatestrictAn array is built by calling
Arraywhere a literal says the same -
tx0/ts:async-without-awaitstrictAn async function contains no
await -
tx0/ts:backtick-string-without-placeholderstrictA template literal has no substitution, so a string would do
-
tx0/ts:blanket-lint-disablestrictA comment turns off every lint rule at once instead of naming one
-
tx0/ts:blocking-dialogstrictalert,confirmorpromptopens a dialog that blocks the page -
tx0/ts:boolean-return-wrappedstrictAn if statement returns
truein one branch andfalsein the other -
tx0/ts:boolean-ternarystrictA conditional expression picks between
trueandfalse -
tx0/ts:call-with-same-thisstrict.callor.applypasses the samethisthat a plain call would -
tx0/ts:cast-through-unknownstrictA value is cast to
unknownoranyand then to another type, bypassing the check -
tx0/ts:chained-assignmentstrictThe value of an assignment or declaration is another assignment
-
tx0/ts:class-member-countstrictA class declares more members than the configured maximum
-
tx0/ts:class-namingstrictA class or type name does not follow the configured case style
-
tx0/ts:collapsible-ifstrictAn if statement without else is the only statement of another
-
tx0/ts:comma-sequencestrictThe comma operator joins expressions outside a for head
-
tx0/ts:compare-to-true-falsestrictAn expression is tested against
trueorfalsewith an equality operator -
tx0/ts:compound-assignment-candidatestrictA variable is assigned the result of an operation on itself, written out in full
-
tx0/ts:concat-instead-of-templatestrictStrings are joined with values by
+where a template literal would read better -
tx0/ts:console-callstrictconsole.logor a sibling writes output directly -
tx0/ts:date-for-timestampstrictA
Dateobject is created only to read the current time as a number -
tx0/ts:default-parameter-before-requiredstrictA parameter with a default value comes before one without
-
tx0/ts:disabled-code-commentstrictA comment holds code that was switched off
-
tx0/ts:duplicate-stringstrictThe same string literal is written more often than the configured maximum in a file
-
tx0/ts:else-after-returnstrictAn
elsefollows a branch that always leaves, so it only adds nesting -
tx0/ts:else-if-without-elsestrictAn if-else-if chain has no final else
-
tx0/ts:empty-interfacestrictAn interface declares no members of its own
-
tx0/ts:environment-specific-globalstrictA member is read from a name for the global object that only some environments define
-
tx0/ts:eqeqeqstrict==or!=compares with type conversion -
tx0/ts:explicit-anystrictA type is written as
any, which switches off type checking for the value -
tx0/ts:exported-letstrictA module exports a binding that can be reassigned
-
tx0/ts:file-lengthstrictA file has more lines of code than the configured maximum
-
tx0/ts:filter-for-existencestrictAn array is filtered whole only to test for a match or take the first one
-
tx0/ts:for-as-whilestrictA for loop has a condition but neither initializer nor update
-
tx0/ts:function-namingstrictA function or method name does not follow the configured case style
-
tx0/ts:global-number-functionstrictparseIntorparseFloatis called through the global scope instead ofNumber -
tx0/ts:glued-quoted-stringsstrictTwo quoted strings on one line are glued with
+ -
tx0/ts:hardcoded-ip-addressstrictA string literal is an IP address of a particular machine
-
tx0/ts:has-own-property-callstricthasOwnPropertyis borrowed from the prototype ofObjectand called -
tx0/ts:identical-function-bodiesstrictTwo functions in a file have the same body
-
tx0/ts:index-as-keystrictA list element's
keyis its index in the array -
tx0/ts:index-of-existencestrictThe position from
indexOfis compared only to learn whether an element is present -
tx0/ts:instance-replaced-by-returnstrictA
returnwith a value in a constructor replaces or drops the new instance -
tx0/ts:json-deep-clonestrictAn object is copied by printing it as JSON and parsing it again
-
tx0/ts:let-annotation-repeats-literalstrictA
letinitialized with a literal is annotated with the type it would get anyway -
tx0/ts:line-continuation-stringstrictA string literal continues on the next line after a backslash
-
tx0/ts:line-lengthstrictA line is longer than the configured maximum
-
tx0/ts:link-target-blankstrictA link opens a new tab without
rel="noopener" -
tx0/ts:lonely-if-in-elsestrictAn else block holds a single if statement
-
tx0/ts:map-then-flatstrict.map(...).flat()maps and flattens in two passes -
tx0/ts:math-pow-callstrictMath.powraises a number to a power where**would -
tx0/ts:method-without-thisstrictA class method never uses
this, so it does not need an instance -
tx0/ts:min-max-ternarystrictA conditional expression picks the smaller or larger of two values by hand
-
tx0/ts:missing-bracesstrictThe body of a control statement is a single statement without braces
-
tx0/ts:namespace-declarationstrictA TypeScript namespace groups code that modules could hold
-
tx0/ts:needless-fragmentstrictA JSX fragment wraps a single element or sits directly inside another element
-
tx0/ts:negated-if-with-elsestrictAn if statement with an else branch tests a negated condition
-
tx0/ts:nested-conditional-expressionstrictA conditional expression is an operand of another
-
tx0/ts:new-on-lowercase-namestrictnewis applied to a name starting with a lower-case letter -
tx0/ts:no-varstrictA variable is declared with
var -
tx0/ts:node-builtin-without-protocolstrictA module that Node has built in is loaded by its bare name, without
node: -
tx0/ts:object-assign-copystrictObject.assigncopies into an object literal where a spread would -
tx0/ts:object-constructor-callstrictAn empty object is built by calling
Objectinstead of writing{} -
tx0/ts:object-shorthandstrictAn object property repeats the name of the variable that gives its value
-
tx0/ts:optional-also-undefinedstrictA parameter or property marked
?also listsundefinedin its type -
tx0/ts:optional-chain-candidatestricta && a.btests an object before reading from it where?.would -
tx0/ts:parameter-reassignedstrictA function body gives one of its parameters a new value
-
tx0/ts:parse-int-without-radixstrictparseIntis called without a radix -
tx0/ts:pattern-space-runstrictA
/.../literal contains a run of spaces -
tx0/ts:prefer-conststrictA variable declared with
letis never assigned again -
tx0/ts:promise-all-singlestrictPromise.allor a sibling combines a list of only one promise -
tx0/ts:promise-wrap-in-asyncstrictAn async function returns
Promise.resolveorPromise.rejectof a value -
tx0/ts:quoted-member-accessstrictA property with a plain name is read with brackets and a string
-
tx0/ts:reduce-without-initialstrictreduceis called without an initial value and throws on an empty array -
tx0/ts:redundant-computed-keystrictA computed property name is a literal written in brackets
-
tx0/ts:redundant-escapestrictA backslash escapes a character that means the same without it
-
tx0/ts:redundant-return-awaitstrictreturn awaitoutside atrywaits for a promise the async function would return anyway -
tx0/ts:require-in-modulestrictrequireloads a module in a file that usesimportandexport -
tx0/ts:return-countstrictA function has more
returnstatements than the configured maximum -
tx0/ts:return-of-fresh-variablestrictA value is stored in a variable only to be returned or thrown right after
-
tx0/ts:reversed-equality-operandsstrictAn equality comparison puts the literal before the value it tests
-
tx0/ts:self-comparisonstrictA value is compared with itself to test for NaN
-
tx0/ts:setter-without-getterstrictA property has a setter but no getter, so reading it gives
undefined -
tx0/ts:shadowed-variablestrictA declaration hides a variable of an enclosing scope
-
tx0/ts:sort-without-comparatorstrictsortortoSortedis called without a compare function and orders elements as strings -
tx0/ts:substr-callstrictThe legacy string method
substris called -
tx0/ts:switch-in-switchstrictA switch is inside a case of another switch
-
tx0/ts:switch-without-defaultstrictA switch handles only listed cases and none for other values
-
tx0/ts:template-in-stringstrictA string with quotes contains a
${...}placeholder, which is not replaced -
tx0/ts:template-in-templatestrictA template literal is inside a substitution of another
-
tx0/ts:this-aliasstrictthisis copied into a variable -
tx0/ts:tiny-switchstrictA switch has fewer than three clauses
-
tx0/ts:todo-commentstrictA comment marks unfinished work with TODO, FIXME or XXX
-
tx0/ts:trim-left-rightstrictThe legacy names
trimLeftortrimRightare called -
tx0/ts:triple-slash-referencestrictA
/// <reference path>comment includes another file instead of an import -
tx0/ts:trivial-type-constraintstrictA type parameter is constrained to
unknownorany, which every type satisfies -
tx0/ts:ts-ignore-commentstrictA
@ts-ignoreor@ts-nocheckcomment hides compiler errors without naming one -
tx0/ts:typeof-on-declared-namestricttypeoftests a declared variable or a property against"undefined" -
tx0/ts:unchecked-bangstrictA
!claims without a check that a value is neithernullnorundefined -
tx0/ts:undefined-initializerstrictA variable is declared with
undefinedas its initial value -
tx0/ts:var-redeclaredstrictThe same name is declared twice with
varin one function -
tx0/ts:variable-namingstrictA variable or parameter name does not follow the configured case style
Java rules 363, 108 of them in default
-
tx0/java:abs-of-hashdefaultMath.absof a hash code or random number, which can still be negative -
tx0/java:ambiguous-injection-constructorsdefaultMore than one constructor of a class is marked @Autowired, which Spring rejects
-
tx0/java:append-object-streamdefaultAn ObjectOutputStream appends to a file, adding a second stream header that readers reject
-
tx0/java:arithmetic-comparatordefaultA reference to max, min or sum is passed where a comparator is expected
-
tx0/java:array-equalsdefaultArrays are compared with
equals, which compares references -
tx0/java:assertion-type-mismatchdefaultAn assertion compares a string with a number or truth value, which are never equal
-
tx0/java:atomic-equalsdefaultequalsis called on an atomic number, which compares identity rather than values -
tx0/java:cache-put-and-cacheabledefaultA method is both @Cacheable and @CachePut, which ask for opposite things
-
tx0/java:char-as-capacitydefaultA character passed to a string builder's constructor sets its capacity, not its content
-
tx0/java:compare-min-valuedefaultA comparison method returns
Integer.MIN_VALUE, which stays negative when negated -
tx0/java:competing-test-annotationsdefaultA test method carries @Test together with another annotation that makes it a test
-
tx0/java:constant-overflowdefaultArithmetic on
intconstants overflows before the result is widened -
tx0/java:dereference-of-nulldefaultA variable is dereferenced right where a test has shown it to be null
-
tx0/java:doubled-unarydefaultA unary
!,-or+is applied twice in a row and cancels out -
tx0/java:duplicate-conditiondefaultA condition of an if-else chain repeats an earlier one
-
tx0/java:duplicate-factory-elementdefaultSet.oforMap.ofgets the same element or key twice and throws when it runs -
tx0/java:duration-unit-mismatchdefaultAn amount converted to one time unit is passed together with another TimeUnit
-
tx0/java:empty-database-passworddefaultA database connection is opened with an empty password
-
tx0/java:equals-swapped-fieldsdefaultEquals compares a field of this object with a differently named field of the other
-
tx0/java:final-proxied-classdefaultA class that the framework subclasses at run time is final, or an entity has final methods
-
tx0/java:finalize-overloaddefaultA method named finalize has parameters or a result, so the runtime never calls it
-
tx0/java:finalizers-on-exitdefaultRunFinalizersOnExit is called, which is unsafe and no longer exists in current JDKs
-
tx0/java:finally-jumpdefaultreturn,breakorcontinueleaves afinallyblock -
tx0/java:format-argumentsdefaultA format string and its arguments do not match
-
tx0/java:frozen-loop-conditiondefaultA loop tests only local variables that the loop never changes, so once entered it never ends
-
tx0/java:has-next-calls-nextdefaulthasNext()of an iterator calls its ownnext() -
tx0/java:identical-operandsdefaultBoth operands of an operator or comparison are the same
-
tx0/java:ignored-read-countdefaultThe count returned by reading into an array is dropped, so partial reads go unnoticed
-
tx0/java:ignored-resultdefaultThe result of a method of an immutable value is not used
-
tx0/java:ignored-serial-versiondefaultA
serialVersionUIDfield is notstatic final long, so serialization ignores it -
tx0/java:ignored-serialization-hookdefaultA
writeObject,readObjectorreadObjectNoDatamethod has a signature serialization does not call -
tx0/java:immutable-collection-mutationdefaultA collection from an unmodifiable or fixed-size factory is changed, which throws
-
tx0/java:impossible-maskdefaultA masked value is compared with a constant it can never equal, or always equals
-
tx0/java:index-removal-skips-elementdefaultElements are removed by index in a loop counting up, so the element after each removed one is skipped
-
tx0/java:inexact-bigdecimal-literaldefaultA
BigDecimalis made from a floating-point literal it cannot hold exactly -
tx0/java:insecure-xml-signaturedefaultThe secure validation of XML signatures is switched off
-
tx0/java:int-bits-to-doubledefaultDouble.longBitsToDoublegets a 32-bit value, which it widens before decoding -
tx0/java:invalid-chrono-unitdefaultA date or time value is given a ChronoUnit it does not support, which throws
-
tx0/java:invalid-regexdefaultA pattern string is malformed, so Pattern.compile throws
-
tx0/java:inverted-clampdefaultNested
Math.minandMath.maxhave their bounds swapped and always give the same value -
tx0/java:invisible-annotation-lookupdefaultReflection looks for an annotation that is not retained at run time, so it is never found
-
tx0/java:jdbc-index-zerodefaultA JDBC parameter or column is addressed with index 0 or less, but they are numbered from 1
-
tx0/java:label-never-targeteddefaultA statement label is never the target of a
breakorcontinue -
tx0/java:ldap-unsafe-optionsdefaultAn LDAP search turns entries into objects, or a connection binds anonymously
-
tx0/java:lock-on-lock-objectdefaultA
synchronizedblock takes the monitor of ajava.util.concurrentlock instead of the lock -
tx0/java:lock-on-valuedefaultA
synchronizedblock locks a string or a boxed primitive, which other code may share -
tx0/java:loop-never-entereddefaultA for loop starts its counter where its condition is already false, so its body never runs
-
tx0/java:mask-with-zerodefaultA value is masked with & 0, which is always 0
-
tx0/java:method-named-like-classdefaultA
voidmethod is named like its class, so it is not the constructor it looks like -
tx0/java:mismatched-lookup-typedefaultA collection is searched for a value of a type its elements or keys can never have
-
tx0/java:misspelled-object-methoddefaultA method named like
hashCode,toStringorequalsbut spelled differently -
tx0/java:mixed-box-conditionaldefaultA conditional expression mixes different numeric boxes, so both are unboxed and converted
-
tx0/java:monitor-call-on-conditiondefaultwaitornotifyis called on a lockCondition, whereawaitorsignalwas meant -
tx0/java:monitor-on-threaddefaultwait,notifyornotifyAllis called on aThread, whose monitor the runtime uses -
tx0/java:negative-size-checkdefaultA size or length is compared with 0 in a way that is always true or always false
-
tx0/java:nested-test-class-unmarkeddefaultAn inner class with JUnit 5 tests lacks @Nested, so its tests never run
-
tx0/java:null-into-non-nulldefaultNull is assigned to, or returned from, something annotated as never null
-
tx0/java:null-where-empty-expecteddefaultnullis passed toOptional.ofor returned where anOptionalis declared -
tx0/java:out-of-range-comparisondefaultA byte, short or char is compared with a constant outside its range, so the result never changes
-
tx0/java:out-of-range-date-fielddefaultA month, day, hour, minute or second is set to a number outside its range
-
tx0/java:overwritten-entrydefaultA map entry or array element is written twice in a row, losing the first value
-
tx0/java:overwritten-incrementdefaultA variable is assigned its own postfix increment or decrement, which leaves it unchanged
-
tx0/java:primitive-array-as-listdefaultAn array of primitives passed to
Arrays.asListbecomes the single element of the list -
tx0/java:regex-duplicate-alternativedefaultAn alternative of a regular expression repeats an earlier one, so it can never be the one that matches
-
tx0/java:regex-impossible-lookaheaddefaultA lookahead in a regular expression contradicts the character that follows it, so the pattern never matches
-
tx0/java:regex-possessive-starvesdefaultA possessive quantifier takes the characters that the next part of the regular expression needs, so it never matches
-
tx0/java:regex-unmatchable-anchordefaultA ^ or $ in a regular expression stands where it can never match, so the pattern never matches
-
tx0/java:regex-unmatched-backreferencedefaultA pattern refers back to a capture that does not exist yet at that point
-
tx0/java:reused-streamdefaultA stream kept in a variable is operated on a second time, which throws
-
tx0/java:rpc-object-extensionsdefaultThe vendor extensions of Apache XML-RPC are switched on, which lets requests deserialize objects
-
tx0/java:same-value-assertiondefaultAn assertion compares a value with itself, so it can never fail
-
tx0/java:scheduled-pool-max-sizedefaultThe maximum pool size of a ScheduledThreadPoolExecutor is set, which has no effect
-
tx0/java:security-debug-enableddefaultThe debug mode of Spring Security is switched on
-
tx0/java:seeded-secure-randomdefaultA
SecureRandomgets a seed written in the source -
tx0/java:self-assignmentdefaultA variable is assigned to itself
-
tx0/java:self-bulk-operationdefaultA collection is passed to its own
addAll,removeAll,retainAllorcontainsAll -
tx0/java:session-fixation-offdefaultThe protection against session fixation is switched off
-
tx0/java:shift-rangedefaultA shift distance is outside the range of the shifted type
-
tx0/java:signed-byte-readdefaultread()of an input stream returns a signed byte, so bytes above 127 look like the end -
tx0/java:skipped-junit-testdefaultA JUnit 5 test method is private, static or returns a value, so JUnit silently skips it
-
tx0/java:split-metacharacterdefaultA string is split at a single regular expression metacharacter
-
tx0/java:spring-app-default-packagedefaultA Spring Boot application class is in the default package, so component scanning reads every class on the class path
-
tx0/java:spring-callback-shapedefaultA method that Spring calls has a signature that Spring rejects or cannot use
-
tx0/java:static-member-annotationdefaultAn injection or validation annotation sits on a static field, where it is ignored
-
tx0/java:stray-semicolon-bodydefaultThe body of an
if,elseor loop is a lone;right after its head -
tx0/java:swapped-assign-operatordefault=+,=-or=!is written where+=,-=or!=was likely meant -
tx0/java:thread-rundefaultThread.runis called wherestartwas meant -
tx0/java:truncated-randomdefaultA random fraction below 1 is cast to an integer type, which always gives 0
-
tx0/java:trust-all-packagesdefaultAn ActiveMQ connection factory is allowed to deserialize objects of every class
-
tx0/java:unchecked-read-castdefaultThe result of
read()is cast tocharorbytebefore the end of input is checked -
tx0/java:unclosed-resourcedefaultA file, socket or archive is opened into a local variable and never closed nor handed on
-
tx0/java:unconditional-self-calldefaultA method calls itself before anything else runs, so it never returns
-
tx0/java:unfinished-test-checkdefaultAn assertion or mock setup is started but never completed, so it checks or does nothing
-
tx0/java:unknown-path-variabledefaultA path variable parameter names a variable that the path template does not have
-
tx0/java:unproxied-annotationdefaultA transaction, async or cache annotation sits on a private or static method, where a proxy cannot apply it
-
tx0/java:unsafe-lazy-initdefaultA field is initialized lazily with a check outside the lock, but is not
volatile -
tx0/java:unsigned-jwtdefaultA JSON Web Token is created or checked with the none algorithm, which has no signature
-
tx0/java:unthrown-exceptiondefaultAn exception is created and dropped instead of thrown
-
tx0/java:untyped-to-array-castdefaultThe
Object[]fromtoArray()is cast to a more specific array type -
tx0/java:unused-streamdefaultA stream pipeline ends without a terminal operation, so none of its steps run
-
tx0/java:value-based-identitydefaultValues of a value-based class such as LocalDate or Optional are compared with == or !=
-
tx0/java:weak-password-encoderdefaultA password encoder keeps passwords readable or hashes them with a quick digest
-
tx0/java:week-year-patterndefaultA date pattern with month and day uses
Y, the week-based year, which is off by one around New Year -
tx0/java:wrong-loop-directiondefaultA loop steps its counter away from the bound of its condition
-
tx0/java:zero-core-threadsdefaultA scheduled executor is built with a core pool size of 0, so its delayed tasks lack a thread
-
tx0/java:zero-divisordefaultAn integer is divided by the literal 0, which throws an ArithmeticException
-
tx0/java:accessor-wrong-fieldrecommendedA getter or setter reads or writes a different field than the one its name says
-
tx0/java:anonymous-collection-subclassrecommendedA collection is filled in an anonymous subclass with an initializer block
-
tx0/java:any-origin-allowedrecommendedCross-origin requests are allowed from every web site with
* -
tx0/java:approximate-math-constantrecommendedPi or e is written as a literal approximation instead of Math.PI or Math.E
-
tx0/java:array-to-stringrecommendedAn array is turned into a string or hash code by identity
-
tx0/java:assert-side-effectrecommendedThe condition of an
assertchanges state, which happens only when assertions are enabled -
tx0/java:assignment-as-conditionrecommendedThe condition of an
if, loop or?:is an assignment rather than a comparison -
tx0/java:basic-auth-headerrecommendedCredentials are sent with HTTP basic authentication, which only encodes them
-
tx0/java:boolean-return-ifrecommendedAn
ifreturnstruein one branch andfalsein the other instead of returning its condition -
tx0/java:boxed-identityrecommendedBoxed numbers are compared with
==or!=, which compare references -
tx0/java:boxing-constructorrecommendedA box is created with its deprecated constructor
-
tx0/java:case-folded-comparisonrecommendedTwo strings are compared after changing their case, where equalsIgnoreCase does it directly
-
tx0/java:catch-null-pointerrecommendedA
NullPointerExceptionis caught instead of checking fornull -
tx0/java:catch-rethrowrecommendedA
catchclause only rethrows the exception it caught -
tx0/java:caught-monitor-staterecommendedAn IllegalMonitorStateException is caught, which only signals a missing synchronized block
-
tx0/java:class-name-comparisonrecommendedA class is identified by comparing its name with a string literal
-
tx0/java:class-of-new-instancerecommendedAn instance is built just to read its Class object
-
tx0/java:clone-without-superrecommendedclone()of a class that can be extended does not callsuper.clone() -
tx0/java:cloneable-without-overriderecommendedA class implements Cloneable but does not override clone()
-
tx0/java:close-in-resource-blockrecommendedA resource of try-with-resources is also closed by hand inside the block
-
tx0/java:command-from-stringsrecommendedAn operating system command is built by joining strings at run time
-
tx0/java:compare-subtractionrecommendedA comparison method returns a difference of two numbers, which can overflow and flip the sign
-
tx0/java:compare-to-constantrecommendedThe result of
compareToorcompareis compared with 1 or -1 -
tx0/java:compare-to-wrong-typerecommendedCompareTo takes another type than the class compares itself with, so Comparable never calls it
-
tx0/java:constant-ivrecommendedAn initialization vector is a constant or an array of zeros
-
tx0/java:constant-saltrecommendedA password is hashed with a salt written in the code
-
tx0/java:cookie-protection-offrecommendedA cookie's
SecureorHttpOnlyflag is switched off or never switched on -
tx0/java:dangling-elserecommendedAn else after two nested ifs without braces belongs to the inner if, whatever the indentation says
-
tx0/java:dead-local-variablerecommendedA local variable is never read or written after its declaration
-
tx0/java:dead-private-fieldrecommendedNothing in its file reads or writes a private field
-
tx0/java:dead-private-typerecommendedNothing in its file refers to a private nested type
-
tx0/java:default-typing-enabledrecommendedJSON input is allowed to name the Java class it is turned into
-
tx0/java:duplicate-lifecycle-methodrecommendedA test class has two setup or teardown methods of the same kind, which run in no fixed order
-
tx0/java:empty-blockrecommendedA block of an
if,else,try,finally,synchronizedor initializer is empty -
tx0/java:empty-catchrecommendedAn exception is caught and ignored without a comment
-
tx0/java:equals-nullrecommendedequalsis called withnull -
tx0/java:equals-overloadrecommendedequalstakes a parameter that is notObject, so it does not overrideObject.equals -
tx0/java:equals-unchecked-castrecommendedequalscasts its argument without checking its type, throwing instead of returningfalse -
tx0/java:equals-without-hashcoderecommendedA class overrides
equalsbut nothashCode -
tx0/java:exception-name-mismatchrecommendedA class whose name ends in
Exceptionis not aThrowable -
tx0/java:exit-time-deletionrecommendedA file is marked with deleteOnExit, which keeps its name in memory until the JVM stops
-
tx0/java:explicit-gcrecommendedA garbage collection is requested from code
-
tx0/java:exposed-static-staterecommendedA
public staticfield can be reassigned, or holds an array whose elements anyone can change -
tx0/java:externalizable-without-no-argrecommendedAn
Externalizableclass has no public constructor without parameters, so it cannot be read back -
tx0/java:finalize-callrecommendedfinalize()is called explicitly -
tx0/java:finalize-overriderecommendedA class overrides
finalize(), which is deprecated and unreliable -
tx0/java:finalize-without-superrecommendedfinalize()of a subclass does not callsuper.finalize() -
tx0/java:float-equalityrecommendedFloating-point values are compared with
==or!=, which rounding makes unreliable -
tx0/java:float-incrementrecommendedA floating-point variable is changed with
++or-- -
tx0/java:forgery-protection-offrecommendedThe protection against cross-site request forgery is switched off
-
tx0/java:fresh-get-instancerecommendedA static getInstance() creates a new object on every call
-
tx0/java:hardcoded-credentialrecommendedA password or secret is written in the source as a string literal
-
tx0/java:hash-field-not-in-equalsrecommendedHashCode mixes in a field that equals ignores, so equal objects can hash differently
-
tx0/java:hashcode-without-equalsrecommendedA class overrides
hashCodebut notequals -
tx0/java:identical-branchesrecommendedEvery branch of an if-else or conditional expression is the same
-
tx0/java:identity-map-value-keyrecommendedAn IdentityHashMap is keyed by boxed numbers or strings, which are equal without being the same object
-
tx0/java:idle-type-parameterrecommendedA method declares a type parameter that it never uses
-
tx0/java:if-after-closing-bracerecommendedAn if starts on the line where the previous if ends, which reads like a missing else
-
tx0/java:ignored-private-parameterrecommendedA private method ignores one of its parameters
-
tx0/java:ignored-status-resultrecommendedA method that reports failure through its result is called and the result is dropped
-
tx0/java:incomplete-copy-constructorrecommendedA copy constructor leaves out a field of its class
-
tx0/java:instanceof-covers-nullrecommendedA value is compared with
nullright before aninstanceoftest that covers it -
tx0/java:int-product-widenedrecommendedTwo ints are multiplied and the result is stored in a long, after it may already have overflowed
-
tx0/java:integer-divisionrecommendedAn integer division is converted to a floating-point number after the fraction is lost
-
tx0/java:internal-api-importrecommendedA class of the JDK's internal packages is imported
-
tx0/java:iterator-next-without-endrecommendedNext() of an iterator neither checks for the end nor delegates, so it fails with the wrong exception
-
tx0/java:javascript-interfacerecommendedA Java object is exposed to the scripts of a WebView
-
tx0/java:jdbc-driver-loadrecommendedA JDBC driver is loaded with Class.forName, which JDBC 4 does by itself
-
tx0/java:lock-on-get-classrecommendedA
synchronizedblock locksgetClass(), which differs between subclasses -
tx0/java:log-and-rethrowrecommendedA caught exception is logged and then thrown again, so it is logged twice or more
-
tx0/java:modified-while-iteratingrecommendedA collection is changed inside an enhanced
forloop over it -
tx0/java:monitor-without-lockrecommendedwait,notifyornotifyAllis called outsidesynchronizedcode -
tx0/java:mutable-enum-fieldrecommendedAn enum has an instance field that is not
final, making its constants shared mutable state -
tx0/java:needless-boxingrecommendedA box is created only to convert or print its value, where a static method does it directly
-
tx0/java:needless-final-jumprecommendedA return or continue is the last statement of its body and changes nothing
-
tx0/java:needless-importrecommendedAn import repeats another or names a class the file sees anyway
-
tx0/java:not-of-equalityrecommendedAn equality comparison is negated with
!instead of using the opposite operator -
tx0/java:null-from-computerecommendedA map's mapping function returns
null, which stores nothing or removes the entry -
tx0/java:null-from-to-stringrecommendedA method callers rely on for a description or a copy hands back
null -
tx0/java:octal-literalrecommendedAn integer literal starts with
0, which makes it octal -
tx0/java:odd-remainderrecommendedAn odd check compares
% 2with 1, which fails for negative numbers -
tx0/java:overridable-call-in-constructorrecommendedA constructor calls a method that a subclass can override before the subclass is set up
-
tx0/java:pointless-finalizer-cleanuprecommendedFinalize() sets fields to null, which does not help the garbage collector
-
tx0/java:predictable-secretrecommendedA secret such as a token or salt comes from a generator whose output can be predicted
-
tx0/java:public-temp-pathrecommendedA file is created at a fixed path in a directory that every user can write to
-
tx0/java:quadratic-string-buildingrecommendedA string is extended with
+on every pass of a loop, copying it each time -
tx0/java:query-from-stringsrecommendedA database query is built by joining strings at run time
-
tx0/java:raw-empty-collectionrecommendedAn empty collection constant of raw type is used instead of its typed factory method
-
tx0/java:reassigned-lock-fieldrecommendedA synchronized block locks a field that other code assigns, so threads can hold different locks
-
tx0/java:record-array-componentrecommendedA record holds an array, which its generated
equalsandhashCodecompare by identity -
tx0/java:regex-anchor-binds-one-alternativerecommendedA ^ or $ in a regular expression applies only to the first or last alternative, not to all of them
-
tx0/java:regex-duplicate-class-memberrecommendedA bracket expression in a pattern names one character more than once
-
tx0/java:regex-empty-grouprecommendedA group of a regular expression is empty, so it matches nothing
-
tx0/java:regex-empty-repeatrecommendedAn unbounded repetition in a regular expression repeats a part that can match nothing
-
tx0/java:regex-lazy-at-endrecommendedA regular expression used to search ends in a reluctant quantifier, which then matches as little as possible: nothing
-
tx0/java:regex-nested-quantifierrecommendedA repeated part of a regular expression contains another unbounded repetition, which can take exponential time
-
tx0/java:regex-replace-literalrecommendedreplaceAllis given a pattern with no regular expression syntax -
tx0/java:regex-unicode-case-missingrecommendedA regular expression ignores case for letters beyond ASCII without the flag that makes it do so
-
tx0/java:repeated-statement-preparationrecommendedA JDBC statement is prepared again on every pass of a loop
-
tx0/java:requested-session-idrecommendedThe session id that the client sent is read and may be trusted
-
tx0/java:scale-sensitive-equalsrecommendedBigDecimal.equalsis used, which also compares the scale, so2.0and2.00differ -
tx0/java:short-crypto-keyrecommendedA key generator is set to a key size that can be broken
-
tx0/java:sign-extended-byterecommendedA signed byte is combined with shifted bits without a mask, so its sign bits overwrite them
-
tx0/java:single-pass-looprecommendedA loop body always ends in
break,returnorthrow, so it runs at most once -
tx0/java:single-use-randomrecommendedA
Randomis created to produce a single value and then dropped -
tx0/java:sleep-while-lockedrecommendedThread.sleepis called while a monitor is held -
tx0/java:string-copy-constructorrecommendedA string is copied with new String, which only makes a duplicate
-
tx0/java:string-identityrecommendedStrings are compared with
==or!=, which compare references -
tx0/java:string-to-stringrecommendedA
Stringis converted to aStringwithtoString() -
tx0/java:swallowed-interruptrecommendedAn
InterruptedExceptionis caught and the interrupt is lost -
tx0/java:switch-fallthroughrecommendedA
caseruns on into the next one without a comment saying it is meant -
tx0/java:synchronized-read-objectrecommendedReadObject is synchronized, although no other thread can see the object it reads
-
tx0/java:thread-as-runnablerecommendedA Thread object is passed where only a Runnable task is needed
-
tx0/java:thread-without-taskrecommendedA subclass of
Threadneither overridesrun()nor passes a task to its constructor -
tx0/java:trust-all-certificatesrecommendedA certificate or host name check accepts everything
-
tx0/java:uncalled-private-methodrecommendedNothing in its file calls a private method
-
tx0/java:unchecked-optional-getrecommendedThe value of an
Optionalis taken withget()without checking that it is there -
tx0/java:unhardened-xml-parserrecommendedAn XML parser factory is created without any setting that limits external entities
-
tx0/java:unlock-outside-finallyrecommendedA lock is released outside a
finallyblock, so an exception leaves it held -
tx0/java:unsynchronized-getterrecommendedA setter is synchronized but the matching getter is not, so readers may see stale values
-
tx0/java:unused-importrecommendedAn imported name is not used in the file
-
tx0/java:url-equalityrecommendedURL objects are compared with equals or hashCode, which resolve host names over the network
-
tx0/java:volatile-compoundrecommendedA
volatilefield is updated with++,--or a compound assignment, which is not atomic -
tx0/java:wait-holding-two-locksrecommendedWait() is called while two monitors are held, so the outer one stays locked while waiting
-
tx0/java:wait-outside-looprecommendedwait()is called without a loop that checks the condition again -
tx0/java:weak-crypto-algorithmrecommendedA digest, cipher or protocol known to be broken is requested by name
-
tx0/java:webview-file-accessrecommendedA WebView is allowed to read local files, to run its debugger, or to expose Java objects to scripts
-
tx0/java:world-writable-filerecommendedA file is given permissions that let every user of the machine change or read it
-
tx0/java:accessibility-overridestrictReflection switches off the access checks of a member
-
tx0/java:any-http-method-mappingstrictA request handler is mapped without naming its HTTP methods, so it answers all of them
-
tx0/java:bare-blockstrictA block stands among statements without a statement that owns it
-
tx0/java:bool-literal-comparisonstrictA value is compared with
trueorfalse -
tx0/java:boolean-ternarystrictA conditional expression chooses between
trueandfalse -
tx0/java:broad-throwstrictA
throwcreates an instance of a broad base class that callers cannot single out -
tx0/java:c-style-arraystrictArray brackets follow the name of a variable or the parameters of a method instead of the type
-
tx0/java:catch-throwablestrictA handler for every throwable, or for fatal errors, lets the program go on after them
-
tx0/java:class-fan-outstrictA class refers to more distinct types than the limit
-
tx0/java:class-literal-is-instancestrictisInstanceis called on a class literal instead of usinginstanceof -
tx0/java:code-in-commentstrictA comment holds code that was switched off
-
tx0/java:collapsible-ifstrictAn
ifcontains only anotherif, and neither has anelse -
tx0/java:command-path-lookupstrictAn operating system command is started by a bare name, found through the PATH
-
tx0/java:concat-in-appendstrictThe argument of
StringBuilder.appendis built with+ -
tx0/java:console-outputstrictOutput is written to standard output or standard error directly
-
tx0/java:constant-interfacestrictAn interface declares only constants
-
tx0/java:constant-namingstrictThe name of a constant does not match the configured pattern
-
tx0/java:contextual-keyword-namestrictA declaration is named with a word that later Java versions made a keyword
-
tx0/java:cyclomatic-complexitystrictA method has more independent paths through it than the limit
-
tx0/java:deep-nestingstrictControl statements are nested deeper than the limit
-
tx0/java:default-value-initializerstrictA field initializer repeats the value the field has before it runs
-
tx0/java:diamondstrictThe type arguments of an instance creation repeat those of the declared type
-
tx0/java:eager-log-messagestrictA log message is built with + before the logger checks whether the level is enabled
-
tx0/java:early-thread-startstrictA constructor starts a thread before the object is fully built
-
tx0/java:embedded-assignmentstrictThe value of an assignment feeds into a larger expression
-
tx0/java:empty-classstrictA class declares nothing and extends nothing
-
tx0/java:empty-methodstrictA method has an empty body without a comment
-
tx0/java:empty-string-conversionstrictA literal is turned into a string by adding it to an empty string
-
tx0/java:error-subclassstrictA class extends Error, which is meant for failures of the virtual machine
-
tx0/java:explicit-array-initializerstrictAn array variable is initialized with new and a type that its declaration already gives
-
tx0/java:external-storagestrictFiles are kept in the external storage of an Android device, which other apps can read
-
tx0/java:field-countstrictThe number of fields of a class is above the limit
-
tx0/java:field-namingstrictThe name of a field does not match the configured pattern
-
tx0/java:float-literal-caststrictA double literal is cast to float instead of being written as a float literal
-
tx0/java:for-as-whilestrictA
forloop has only a condition, like awhileloop -
tx0/java:generic-throwsstrictA method declares
throws Exceptionorthrows Throwable -
tx0/java:generic-without-argumentsstrictA generic JDK type is used without type arguments
-
tx0/java:hardcoded-ip-addressstrictAn IP address is written in the code as a string
-
tx0/java:if-chain-without-elsestrictAn if-else-if chain ends without an else
-
tx0/java:implied-modifierstrictA modifier states what the language already implies
-
tx0/java:import-on-demandstrictEvery class of a package is imported with
* -
tx0/java:index-of-positivestrictThe result of indexOf is compared with > 0, which misses a match at the start
-
tx0/java:inline-numeric-literalstrictA numeric literal other than a small common one is written inline instead of named
-
tx0/java:instance-initializerstrictA named class has an instance initializer block
-
tx0/java:instanceof-on-caughtstrictA caught exception is tested with instanceof instead of being caught by its own type
-
tx0/java:instantiable-utility-classstrictA class with only static members has an implicit public constructor
-
tx0/java:key-set-lookupstrictA loop over a map's keys looks each value up again with
get -
tx0/java:labeled-statementstrictA statement carries a label for a break or continue that jumps out of nested loops
-
tx0/java:lambda-block-bodystrictA lambda body is a block with a single statement where an expression would do
-
tx0/java:lambda-param-parensstrictThe single untyped parameter of a lambda is put in parentheses
-
tx0/java:legacy-date-apistrictDates are handled with Date, Calendar or SimpleDateFormat instead of java.time
-
tx0/java:legacy-synchronized-classstrictA collection or buffer that locks on every call is created
-
tx0/java:legacy-thread-groupingstrictA ThreadGroup is created, whose operations are mostly deprecated and unsafe
-
tx0/java:local-hides-fieldstrictA local variable has the name of a field of its class, which it hides
-
tx0/java:local-namingstrictThe name of a local variable or parameter does not match the configured pattern
-
tx0/java:logger-of-other-classstrictA logger is named after another class than the one it is declared in
-
tx0/java:long-anonymous-classstrictAn anonymous class has more lines of code than the limit
-
tx0/java:long-boolean-expressionstrictA boolean expression joins more conditions with
&&and||than the limit -
tx0/java:long-casestrictA
caseof aswitchhas more lines of code than the limit -
tx0/java:long-filestrictA file has more lines of code than the limit
-
tx0/java:long-lambdastrictA lambda body has more lines of code than the limit
-
tx0/java:long-linestrictA line has more characters than the limit
-
tx0/java:long-methodstrictA method body has more lines of code than the limit
-
tx0/java:long-parameter-liststrictThe parameter list of a method or constructor is longer than the limit
-
tx0/java:loop-inequalitystrictA counting loop ends on
!=instead of<or> -
tx0/java:lost-exception-causestrictAn exception is thrown from a
catchblock without the caught exception as its cause -
tx0/java:lowercase-literal-suffixstrictA numeric literal ends in a lower case l, f or d, and l looks like the digit 1
-
tx0/java:manual-array-copystrictAn array is copied element by element in a loop
-
tx0/java:many-loop-jumpsstrictA loop has more exits and restarts than the limit allows
-
tx0/java:mergeable-catchesstrictTwo catch clauses of one try have the same body and could be one multi-catch
-
tx0/java:method-countstrictThe number of methods of a type is above the limit
-
tx0/java:method-namingstrictA method name does not match the configured pattern
-
tx0/java:missing-bracesstrictThe body of an
if,elseor loop is a single statement without braces -
tx0/java:missing-override-annotationstrictA method that overrides a method of Object lacks @Override
-
tx0/java:missing-serial-versionstrictA serializable class leaves its stream version to be computed from its shape
-
tx0/java:modifier-orderstrictModifiers are written in another order than the one the language specification recommends
-
tx0/java:multiple-declaratorsstrictSeveral variables are declared in one declaration
-
tx0/java:names-differ-by-casestrictA field name differs from a method name only in case
-
tx0/java:nan-checkstrictA number is compared with itself to test for NaN
-
tx0/java:native-deserializationstrictObjects are read back with Java's built-in serialization
-
tx0/java:negated-ternary-conditionstrictThe condition of a conditional expression is negated, where swapping the branches reads plainer
-
tx0/java:nested-conditionalstrictA conditional expression is nested inside another one
-
tx0/java:nested-switchstrictA
switchis nested inside anotherswitch -
tx0/java:nested-trystrictA
trywith handlers is nested in the block of another one -
tx0/java:nesting-weighted-complexitystrictA method's branches, weighted by how deep they are nested, add up past the limit
-
tx0/java:no-op-arithmeticstrictAn arithmetic or bit operation leaves its operand unchanged, as x * 1 or x | 0
-
tx0/java:non-short-circuit-logicstrictBoolean conditions are joined with & or | instead of && or ||, so both sides always run
-
tx0/java:notify-onestrictnotify()wakes a single waiting thread chosen by the runtime -
tx0/java:optional-in-signaturestrictA method or constructor takes an
Optionalparameter -
tx0/java:optional-null-comparisonstrictAn
Optionalis compared withnull -
tx0/java:optional-wrapped-containerstrictA method hands back an Optional around a collection, map or array
-
tx0/java:overlapping-throwsstrictA throws clause lists an exception twice, or one that another listed exception covers
-
tx0/java:package-namingstrictThe name of a package does not match the configured pattern
-
tx0/java:pass-through-overridestrictA method overrides another only to call it with the same arguments
-
tx0/java:platform-charsetstrictText is converted to or from bytes with the platform default charset
-
tx0/java:print-stack-tracestrictAn exception is printed to standard error with
printStackTrace() -
tx0/java:private-read-resolvestrictReadResolve of a class that can be extended is private, so subclasses do not inherit it
-
tx0/java:process-exitstrictThe virtual machine is stopped outside a
mainmethod -
tx0/java:public-finalizestrictFinalize() is overridden as public, so any code can call it
-
tx0/java:public-instance-fieldstrictA class has a public field that is neither static nor final
-
tx0/java:reflective-class-loadstrictA class is loaded by a name computed at run time
-
tx0/java:regex-char-alternationstrictA choice between single characters in a regular expression is written with | instead of a class
-
tx0/java:regex-redundant-groupstrictA non-capturing group of a regular expression neither holds a choice nor is repeated, so it changes nothing
-
tx0/java:regex-redundant-quantifierstrictA regular expression has a quantifier {1}, which changes nothing, or {0}, which removes its part
-
tx0/java:regex-repeated-spacesstrictA regular expression holds several spaces in a row, which are hard to count
-
tx0/java:regex-single-member-classstrictA bracket expression in a pattern contains just one letter or digit
-
tx0/java:repeated-string-literalstrictThe same string literal is written several times in a file
-
tx0/java:return-countstrictThe number of
returnstatements in a method is above the limit -
tx0/java:return-fresh-localstrictA local variable is returned or thrown right after it is declared
-
tx0/java:serializable-inner-classstrictA serializable inner class is not static, so serializing it also serializes its outer object
-
tx0/java:size-compared-for-emptinessstrictEmptiness is tested by comparing a size or length with 0 or by equality with an empty string
-
tx0/java:static-written-from-instancestrictAn instance method or constructor assigns a static field, which all instances share
-
tx0/java:stray-semicolonstrictA semicolon stands alone where it does nothing
-
tx0/java:stream-for-eachstrictA stream is created only to call forEach, which the collection has itself
-
tx0/java:suppressed-warningsstrictCompiler warnings are switched off with @SuppressWarnings
-
tx0/java:switch-shapestrictA
switchstatement lacks adefault, has it before other labels, or has fewer than three labels -
tx0/java:task-commentstrictA comment marks work left to do with
TODO,FIXMEorXXX -
tx0/java:throw-in-finallystrictAn exception is thrown from a
finallyblock, replacing any exception being thrown -
tx0/java:transient-without-serializationstrictA field is transient in a class that cannot be serializable
-
tx0/java:type-namingstrictA class, interface, enum or record name does not match the configured pattern
-
tx0/java:type-parameter-hides-outerstrictA method declares a type parameter with the name of a type parameter of its class
-
tx0/java:type-parameter-namingstrictThe name of a type parameter does not match the configured pattern
-
tx0/java:unencrypted-urlstrictA connection address uses a protocol without encryption
-
tx0/java:webview-javascript-enabledstrictJavaScript is switched on for a WebView
C rules 132, 50 of them in default
-
tx0/c:bitwise-precedencedefaultA comparison is an operand of a bitwise operator without parentheses
-
tx0/c:char-compared-with-eofdefaultA
charvariable is compared withEOF, which acharcannot tell apart from a real character -
tx0/c:check-after-dereferencedefaultA pointer is tested for NULL after it was already dereferenced
-
tx0/c:comparison-result-as-onedefaultThe result of
strcmpormemcmpis compared with 1 or -1, though only its sign is defined -
tx0/c:constant-assignment-conditiondefaultA condition assigns a constant where a comparison was meant
-
tx0/c:constant-index-out-of-boundsdefaultAn array is indexed with a constant outside its bounds
-
tx0/c:constant-overflowdefaultArithmetic on
intconstants overflows the range ofint -
tx0/c:constant-size-exceeds-arraydefaultA constant size given with an array is larger than the array
-
tx0/c:copy-onto-itselfdefaultA buffer is copied onto itself with a function that requires them apart
-
tx0/c:discarded-allocationdefaultThe result of a function that allocates is discarded, so it can never be released
-
tx0/c:division-by-zerodefaultAn integer is divided by a constant zero
-
tx0/c:double-freedefaultMemory is freed twice in a row
-
tx0/c:duplicate-casedefaultTwo case labels have the same value
-
tx0/c:duplicate-conditiondefaultA condition of an if-else chain repeats an earlier one
-
tx0/c:empty-if-bodydefaultA semicolon right after the condition of an
ifis its whole body -
tx0/c:empty-loop-bodydefaultA semicolon right after the head of a loop is its whole body, and the block after it runs once
-
tx0/c:expression-without-effectdefaultAn expression statement computes a value and throws it away
-
tx0/c:format-argumentsdefaultA format string of
printfand its arguments do not match -
tx0/c:free-non-heapdefaultfreeis given memory that was not allocated on the heap -
tx0/c:free-pointer-offsetdefaultfreeis given a pointer computed by adding to or subtracting from another pointer -
tx0/c:getsdefaultgetsis called -
tx0/c:getwddefaultgetwdis called -
tx0/c:identical-operandsdefaultBoth operands of an operator are the same
-
tx0/c:impossible-conditiondefaultTwo comparisons of the same value with constants make a condition that is always false or always true
-
tx0/c:insecure-temporary-filedefaultA temporary file name is made with a function that leaves time for another process to take the name
-
tx0/c:loop-past-array-enddefaultA loop over an array runs one step past its end because its condition uses
<= -
tx0/c:memset-swappeddefaultmemsetis called with a length of zero, its last two arguments swapped -
tx0/c:memset-value-truncateddefaultmemsetis given a fill value that does not fit in a byte -
tx0/c:misleading-indentationdefaultA statement is indented as if it belonged to the body of an
ifor loop without braces, but runs after it -
tx0/c:nested-sizeofdefaultsizeofis applied to the result of anothersizeof -
tx0/c:null-dereferencedefaultA pointer is dereferenced where it is known to be NULL
-
tx0/c:open-create-without-modedefaultopenis asked to create a file but is not given the permissions for it -
tx0/c:release-mismatchdefaultA resource is released with the function for another kind of resource
-
tx0/c:remainder-by-onedefaultThe remainder of a division by one is taken, which is always zero
-
tx0/c:return-local-addressdefaultA function returns the address of one of its local variables
-
tx0/c:reversed-compound-assignmentdefaultAn assignment is written
=+or=-where+=or-=was probably meant -
tx0/c:scanf-unbounded-stringdefaultscanfreads a string into a buffer with no limit on its length -
tx0/c:self-assignmentdefaultA value is assigned to itself
-
tx0/c:shift-rangedefaultA shift count is negative or not less than the width of the value
-
tx0/c:sizeof-array-parameterdefaultsizeofis applied to a parameter declared as an array, which is a pointer -
tx0/c:sizeof-pointer-allocationdefaultMemory for what a pointer points to is allocated with the size of the pointer itself
-
tx0/c:sizeof-pointer-lengthdefaultThe length passed with a buffer is the size of the pointer to it
-
tx0/c:sprintf-reads-destinationdefaultsprintfreads from the buffer it writes to -
tx0/c:string-comparisondefaultStrings are compared with
==or!=, which compares their addresses -
tx0/c:string-literal-writedefaultMemory of a string literal is written through a pointer to it
-
tx0/c:strncat-sizedefaultstrncatis given the size of its destination as the number of characters to append -
tx0/c:uninitialized-readdefaultA local variable is read before any value is assigned to it
-
tx0/c:unsequenced-modificationdefaultA variable is changed twice, or changed and read, in one expression without a sequence point between
-
tx0/c:unsigned-zero-comparisondefaultAn unsigned value is tested for being negative
-
tx0/c:use-after-freedefaultMemory is used through a pointer after the pointer was freed
-
tx0/c:alloca-callrecommendedMemory is taken from the stack with
alloca, which cannot report failure -
tx0/c:array-drops-terminatorrecommendedA character array is initialized with a string exactly as long as the array, leaving out the terminating zero
-
tx0/c:assert-side-effectrecommendedThe condition of
assertchanges a variable, which does not happen when assertions are off -
tx0/c:assignment-in-conditionrecommendedA condition is an assignment without parentheses that mark it as meant
-
tx0/c:check-then-openrecommendedA file is checked with
accessand opened by name afterwards, so it may have changed in between -
tx0/c:chroot-without-chdirrecommendedchrootis called without achdirafter it, so the working directory stays outside the jail -
tx0/c:duplicate-includerecommendedA header is included twice in the same file
-
tx0/c:erased-before-freerecommendedMemory is cleared with
memsetright before it is freed, which the compiler may drop -
tx0/c:errno-not-clearedrecommendederrnois tested after a conversion function without being set to zero before the call -
tx0/c:fallthroughrecommendedA case of a switch falls through into the next one without saying so
-
tx0/c:feof-looprecommendedA loop tests
feofbefore reading, so it runs once more after the last read fails -
tx0/c:floating-loop-counterrecommendedA loop counts with a floating variable, so rounding changes how often it runs
-
tx0/c:format-from-variablerecommendedA variable is used as the format of
printfwithout other arguments -
tx0/c:hardcoded-passwordrecommendedA password or secret is written into the source as a string literal
-
tx0/c:identical-branchesrecommendedBoth branches of an if-else or a conditional expression are the same
-
tx0/c:ignored-privilege-changerecommendedThe result of a call that drops privileges is ignored, so a failure leaves them in place
-
tx0/c:integer-division-to-floatingrecommendedAn integer division is stored in a floating variable, after its fraction is already lost
-
tx0/c:leak-on-early-returnrecommendedA function returns without freeing memory it allocated and still holds only in a local variable
-
tx0/c:malloc-strlenrecommendedMemory for a copy of a string is allocated without room for its terminating zero
-
tx0/c:not-precedencerecommendedA negation with
!is compared with a value that is not a truth value -
tx0/c:predictable-random-secretrecommendedA value that looks like a secret is made with
rand, whose output can be predicted -
tx0/c:printf-writes-countrecommendedA format of
printfhas the%nconversion, which writes to memory -
tx0/c:putenv-local-bufferrecommendedputenvis given a local array, which the environment keeps using after the function returns -
tx0/c:realloc-same-pointerrecommendedThe result of
reallocis assigned to the pointer it was given, which is lost if it fails -
tx0/c:shell-command-from-variablerecommendedA shell command is run from a string that is not a literal
-
tx0/c:signed-one-bit-fieldrecommendedA bit-field of one bit has a signed type, so it holds 0 and -1 rather than 0 and 1
-
tx0/c:sscanf-unbounded-stringrecommendedsscanfcopies a word of its input into a buffer with no limit on its length -
tx0/c:strncmp-short-lengthrecommendedstrncmpcompares fewer characters than the string literal it is given has -
tx0/c:strncpy-source-lengthrecommendedThe limit of
strncpyis the length of its source -
tx0/c:tls-verification-disabledrecommendedThe verification of TLS certificates is turned off
-
tx0/c:unchecked-allocation-userecommendedMemory from
mallocis used right away without a test that the allocation succeeded -
tx0/c:unreachable-coderecommendedA statement follows a
return,break,continueorgotoin the same block and never runs -
tx0/c:unused-labelrecommendedA label is never the target of a
goto -
tx0/c:void-mainrecommendedmainis defined to returnvoidinstead ofint -
tx0/c:weak-cryptographyrecommendedA hash or cipher that is broken for security purposes is used
-
tx0/c:world-writable-moderecommendedA file is given permissions that let every user write to it
-
tx0/c:allocation-size-productstrictThe size given to
mallocorreallocis a product that may overflow unchecked -
tx0/c:boolean-expression-complexitystrictA condition joins more
&&and||operators than the configured maximum -
tx0/c:boolean-literal-comparisonstrictA value is compared with
trueorfalse -
tx0/c:collapsible-ifstrictAn
ifwithoutelseholds only anotherifwithoutelse, which could be one condition -
tx0/c:comma-in-conditionstrictThe condition of an
ifor loop is a comma expression, so only its last part decides -
tx0/c:commented-out-codestrictA comment holds code that was switched off
-
tx0/c:constant-if-conditionstrictThe condition of an
ifis a constant, so one branch never runs -
tx0/c:ctype-plain-charstrictA plain
charis passed to a function ofctype.h, which is undefined for negative values -
tx0/c:cyclomatic-complexitystrictA function has more independent paths than the configured maximum
-
tx0/c:default-not-laststrictThe
defaultcase of aswitchis not its last case -
tx0/c:else-after-jumpstrictAn
elsefollows a branch that always returns or jumps -
tx0/c:empty-blockstrictThe body of an
if,elseor loop is an empty block without a comment -
tx0/c:empty-parameter-liststrictA function definition has empty parentheses instead of
(void) -
tx0/c:file-lengthstrictA file has more lines of code than the configured maximum
-
tx0/c:floating-equalitystrictFloating values are compared for exact equality
-
tx0/c:function-lengthstrictA function body has more lines of code than the configured maximum
-
tx0/c:goto-into-blockstrictA
gotojumps into a block past declarations that initialize variables -
tx0/c:local-address-in-globalstrictThe address of a local variable is stored in a global variable, where it outlives the variable
-
tx0/c:loop-counter-assignedstrictThe counter of a
forloop is also changed in the body of the loop -
tx0/c:lowercase-long-suffixstrictA literal has the suffix
l, which looks like the digit1 -
tx0/c:macro-body-unparenthesizedstrictA macro that stands for an expression with an operator has no parentheses around it
-
tx0/c:macro-parameter-unparenthesizedstrictA parameter of a macro is used next to an operator without parentheses around it
-
tx0/c:missing-include-guardstrictA header has no include guard and no
#pragma once -
tx0/c:mixed-declaratorsstrictOne declaration declares pointers and non-pointers together
-
tx0/c:negative-left-shiftstrictA negative value is shifted left
-
tx0/c:nested-conditionalstrictA conditional expression is nested in another one
-
tx0/c:nesting-depthstrictControl statements are nested deeper than the configured maximum
-
tx0/c:non-reentrant-functionstrictA library function that returns a pointer to shared static storage is called
-
tx0/c:old-style-definitionstrictA function is defined in the old style, with the types of its parameters declared after the parentheses
-
tx0/c:parameter-countstrictA function takes more parameters than the configured maximum
-
tx0/c:redundant-boolean-conditionalstrictA conditional expression chooses between
trueandfalse -
tx0/c:register-storagestrictA local variable is declared
register -
tx0/c:return-countstrictA function has more
returnstatements than the configured maximum -
tx0/c:setjmp-longjmpstrictControl is transferred with
setjmpandlongjmp -
tx0/c:shadowed-variablestrictA local variable has the name of a variable or parameter of an enclosing scope in the same function
-
tx0/c:shift-into-sign-bitstrictA constant
intis shifted left into or past its sign bit -
tx0/c:stray-semicolonstrictA second semicolon after a statement makes an empty statement
-
tx0/c:string-literal-pointerstrictA pointer to non-const
charis made to point to a string literal -
tx0/c:strlen-in-loop-conditionstrictThe condition of a loop calls
strlenon a string the loop does not change, once per step -
tx0/c:switch-without-defaultstrictA
switchhas nodefaultcase -
tx0/c:todo-commentstrictA comment marks work left to do with
TODO,FIXMEorXXX -
tx0/c:unbounded-sprintfstrictsprintfwrites formatted text into a buffer whose size it does not know -
tx0/c:unbounded-string-copystrictA string is copied or appended with a function that does not know the size of the destination
-
tx0/c:unchecked-number-parsestrictA number is parsed with
atoioratof, which cannot report invalid input -
tx0/c:unused-local-variablestrictA local variable is declared but never used
-
tx0/c:unused-static-functionstrictA
staticfunction is defined but never used in its file
No rule matches. Clear the search, or pick another language or tier. If tx0 should have this rule, request it.