Code Quality detectors

Ineffective Variable Assignment

Variable assignment before command execution not affecting the current shell environment.

End token not found

The end token EOF was not found in the here document.

Invalid ShellCheck Directive Placement

ShellCheck directives incorrectly placed within case statement branches.

Variable Assignment Syntax

Proper syntax for variable assignments in shell scripting without spaces around the equals sign.

SSH Stdin Interference

SSH command unexpectedly consuming stdin, causing loop iteration issues.

Glob Pattern Safety

Use './glob' or '-- glob' to prevent dash-prefixed filenames from becoming options.

Sensitive bourne shells

Bourne shells are sensitive to whitespace, where spaces can change script behavior.

Avoid LS-Grep

Prefer globs or loops over ls-grep.

Unrecognized shebang

Unrecognized shebang, Tool supports only 'sh/bash/dash/ksh'. Add a 'shell' directive.

Shebang Mismatch

Avoid non-standard features in '/bin/sh' scripts.

String Length Calculation

Use ${#variable} for efficient string length calculation.

Unicode Dash In Command

Shell script uses a Unicode dash instead of ASCII minus, causing syntax errors in commands or expressions.

Ensure no spaces are used

Ensure no spaces are used when assigning values in code.

Grouping expressions

Avoid using square brackets to group subexpressions inside square bracket statements.

Single quotes strictly terminate

In POSIX shell, single quotes strictly terminate quoted segments without interpreting any characters within.

Unnecessary Single Quotes

Use double quotes instead of single quotes for variable expansion in shell scripts.

Leading Zero Arithmetic

Avoid using leading zeros in numeric literals in shell arithmetic.

Backslash followed by a linefeed

Single-quoted strings treat backslash followed by a linefeed as a literal backslash and linefeed, with no special meaning.

Use of terminate commands

Use either '&' or ';' to terminate commands, but not both.

Missing exec Terminator

Incorrect usage of '-exec' in shell scripts, leading to unexpected behavior.

Incorrect Tick Usage

Incorrect tick character usage.

Semicolons directly after else

Remove semicolon directly after else.

Array Element Separation

Separate array elements with spaces, not commas, in shell scripts.

Invalid Unary Test Operator

Use of non-existent unary operator in test expression.

Shebang Placement

Shebang not on the first line of the script.

Incorrectly used escape sequences

The problem involves replacing literal '\t' with actual tab characters using the command $(printf '\t').

Improper use of curly braces

Improper use of '{'' in commands affects syntax, when not treated as a separate token, it can lead to errors.

Missing Space Before Colon

Space missing before colon in shell script.

Pipeline Assignment Syntax

Incorrect syntax for assigning pipeline output to a variable.

Non Portable Character Class

Shell script uses non-portable character ranges instead of POSIX character classes for case conversion.

Here-Document Command Terminator Placement

Place command terminators on the line with the here-document initiator.

Test operator missing an operand

It detected a test operator missing an operand.

Expr Modernization

Replace 'expr' with modern shell constructs.

Missing Function Opening Brace

A function definition lacking the opening curly brace {, causing syntax error in shell.

Missing Space Before Comment

Shell script contains a comment without a preceding space, potentially causing syntax errors.

Arithmetic Expression Syntax

Missing dollar sign in arithmetic expression.

Reversed Shebang

Shell script uses reversed shebang (!#) instead of the correct form (#!).

Unsupported Decimal Comparison

Shell scripts cannot natively handle decimal comparisons.

Semicolons directly after then

Remove semicolons immediately following the keyword 'then'.

ShellCheck Directive Placement

Place ShellCheck directives before complete compound commands.

Missing Space After Function Name

Shell script function declaration lacks required space or newline between function name and body.

Unquoted Regex Matching

Don't quote the right-hand side (RHS) of the '=~' operator, as it causes the pattern to be treated as a literal string rather than a regular expression.

Missing Space Before Negation

Space missing before negation operator in shell command.

Redirection Misinterpretation

Preventing shell from interpreting a comparison as a file redirection.

Unexpected Directive

Unexpected or incorrectly formatted shellcheck directive.

Unquoted Special Parameters

Use quoted special parameters to prevent word splitting and globbing.

Command Expansion Error

Use '$(..)' for command substitution instead of '..'.

Do not use unicode non-breaking space

Delete the unicode non-breaking space and replace it with a regular space.

Unnecessary Brackets In Tr

Shell script incorrectly uses square brackets around character ranges in tr command.

Unquoted Command Substitution

Avoid unquoted command substitutions to prevent word splitting and globbing.

Incorrect Redirection Order

Incorrect order of stdout and stderr redirection in shell scripts.

Unexpected opening parenthesis

An unexpected opening parenthesis was found, revise your script to clarify its intended use.

Incorrect Regex Operator

Incorrect regex operator usage.

Unicode Quote Usage

Presence of Unicode quotes instead of ASCII quotes.

Single-Iteration Loop

Ensure for loops iterate over multiple values.

Integer Division Precision Loss

Shell script performs integer division before multiplication, potentially losing precision in calculations.

File Read-Write Race Condition

Simultaneous reading and writing of the same file in a pipeline, leading to data loss or corruption.

Unable To Follow Source

ShellCheck unable to analyze sourced file due to access issues or configuration.

Invalid Parentheses Usage

Shell script contains syntax error due to invalid use of parentheses, causing parsing to fail.

Trailing Space After Backslash

Shell script contains trailing spaces after a backslash used for line continuation, causing syntax errors.

Shebang Syntax Correction

Eliminate spaces between '#' and '!' in the shebang.

Unquoted tr Arguments

Lack of quotes around 'tr' command arguments.

Use shell logical operators

Grouping inside square bracket is not preferred; use shell logical operators instead.

Incorrect Command Substitution in Find Exec

Ensure correct command expansion when using find's -exec option.

Non-empty then clause

Shells require non-empty then clauses; use a dummy command like true for a no-operation.

Incorrect Comment Syntax

Use correct comment syntax.

Suspicious End Quote

Potential quote termination issue.

Directive Comment Syntax

Use proper syntax for comments in ShellCheck directives.

Unmatched Keyword

Shell script contains an unmatched or extra keyword, causing a syntax error and parsing failure.

Unbraced Array Expansion

Shell script uses unbraced syntax for array expansion, potentially leading to incorrect interpretation.

Prefer Find Over LS

Use 'find' for file operations instead of 'ls'.

Missing Do Keyword

A loop that appears to be missing a do statement, causing syntax error in shell script.

Then after if statement

The script has a parsing error indicating a missing 'then' keyword after 'if' or 'elif' conditions.

Invalid Test Operator Usage

Use of non-existent binary operator in test expression.

Null-Terminated Filename Handling

Use null-terminated filenames with 'find' and 'xargs'.

Function in External Command

Shell functions cannot be passed to external commands.

Avoid Complex Logical Expressions

Don't use' A && B || C' as a substitute for if-then-else constructs.

Unquoted RHS Comparison

Quote the right-hand side of equality operators in Bash conditional expressions.

Incorrect Keyword Capitalization

Shell script uses incorrectly capitalized keyword, leading to syntax error.

Unquoted Array Expansion

Missing quotes around array expansion.

Unnecessary Exec Command

Unintended termination of script execution due to misuse of 'exec' command.

Document is not properly terminated

Document isn't properly terminated because the terminator is not on a separate line by itself.

Constant Comparison

Ensure variables are properly referenced in shell comparisons.

Sensitive whitespace of bourne shells

Bourne shells are very sensitive to whitespace, and missing spaces can change script behavior.

Avoid escaping parentheses

Avoid escaping parentheses inside square bracket expressions.

Tr Misused For Word Replacement

Shell script incorrectly uses tr command to replace words instead of individual characters.

Incorrect Logical Operator

Incorrect use of logical OR (||) instead of AND (&&) in conditional checks.

Bracket Spacing in Conditional Statements

Proper spacing before opening brackets in shell conditional statements.

Command Assignment

Use '$(cmd)' for command output assignment.

Incorrect Numeric Comparison

Incorrect use of string comparison operator instead of numeric comparison in shell scripts.

Here-doc Whitespace

Remove trailing whitespace after here-document end token.

Useless Cat Elimination

Avoid unnecessary use of 'cat' for single file input.

UTF-8 BOM Present

Shell script file contains a UTF-8 Byte Order Mark (BOM), potentially causing execution issues.

PS Grep Alternative

Use pgrep for process lookup.

Glob Matching in Test Brackets

Use double square brackets for glob pattern matching in shell scripts.

Unnecessary Dollar In For Loop

For loop in shell script incorrectly uses $ on the iterator variable name.

Here-Document End Token Isolation

Keep the here-document end token on a separate line without additional content.

Dollar should be escaped with a backslash

In double quotes, $ is special but can be interpreted literally in specific contexts; use a backslash to escape it when intended as literal.

Unnecessary Quoting in Loop

Ensuring that command substitution in for loops is properly handled to get the intended iteration behavior.

Here-doc Comment

Avoid comments on the same line as here-document end token.

Only literals can be escaped

Incorrect escape sequences are ignored, use a literal backslash, single quote, or correct escape method.

Unquoted Grep Patterns

Lack of quotes around pattern arguments in 'grep' command.

Find Print Zero Usage

Using 'find -print0' or 'find -exec' for safer file handling

Misused Regex Operator

Use correct operator for pattern matching in shell conditionals.

Incorrect Branching Keyword

Incorrect use of 'elseif' or 'elsif' instead of 'elif' in shell scripts.

Invalid unary test operator usage

Identified an invalid unary test operator usage.

Detects if statement without terminator

Detects an if statement without a matching terminating fi.

Unquoted Find Patterns

Lack of quotes around pattern arguments in 'find' command.

Unexpected Redirection in Comparison

Incorrect use of the less-than '<' or greater-than '>' operator in shell conditional expressions.

Process only removes tabs

The process only removes tabs, not spaces, but your editor might convert tabs to spaces automatically.

Missing Spaces in Comparison

Ensure spaces around comparison operators.

Misplaced Line Continuation Operator

Pipe, OR, or AND operators incorrectly placed at the start of a line.

POSIX Shell Compatibility

Ensure script adheres to POSIX shell standards.

Arithmetic Expansion Command Execution

Prevent unintended command execution from arithmetic expansions.

Shell Prompt Escape Sequences

Shell prompt uses unescaped escape sequences, leading to display issues.

Echo Escape Sequences

Shell script uses echo to print escape sequences, which doesn't work as intended.

Command Argument Handling

Use arrays or functions for complex command arguments instead of strings.

Brace Expansion Limitation

Avoid using variables in brace range expansions in Bash.

Escape Dollar Sign in Quotes

Use backslash to escape $ within quotes instead of ending quotes.

Braces required for positionals

Certain variables are interpreted as another variable followed by a literal string, needing curly braces for clarity.

Unnecessary Backslash Escape

Avoid unnecessary backslash escapes.

Non Constant Source

Shell script uses a non-constant source path, which can't be statically analyzed for potential issues.

Variable Indirection

Invalid variable assignment. Use arrays, declare, or read/eval for indirection.

Tilde Expansion

Use '$HOME' instead of tilde in quotes.

Unnecessary Variable Expansion

Avoid unnecessary dollar signs in arithmetic expressions.

Use of if and then

The problem involves checking the exit code or output of a command in a shell script using different conditional constructs.

Incorrect Equality Operator

Shell script uses == for assignment or comparison outside of test brackets.

Unescaped Variable in Remote Command

Properly escape variables in remote commands to prevent premature expansion.

Unnecessary Echo Pipe

Piping to 'echo' command incorrectly.

Keywords being used as arguments

Identified keywords being used as arguments instead of shell commands, leading to improper interpretation.

Unescaped Variable

Shell script incorrectly uses unescaped quotes within a string, causing syntax errors.

Find Loop Safety

Use safe alternatives to iterate over find output.

Read Lines with While Loop

Use while loop for line-by-line processing.

Unclosed String

Double-quoted string is not properly closed.

Unclosed Do Statement

A loop structure with do keyword lacking the corresponding done, causing syntax error in shell script.

Misplaced ShellCheck Directive

ShellCheck directives incorrectly placed after commands.

Regex Asterisk Misuse

Shell script misuses asterisk in regex, potentially leading to unintended matches.

Source Parsing Failed

ShellCheck unable to parse a sourced file, leading to incomplete analysis.

Unnecessary Echo

Remove unnecessary 'echo' when outputting command results.

Unintended Literal Brace

Shell script contains literal braces where command grouping or parameter expansion may be intended.

Incorrect Function Parameter Declaration

Incorrect attempt to declare function parameters in shell script, leading to potential errors.

Multi-Parameter Shebang

Use of multiple parameters in shebang line, causing script execution failure on most operating systems.

Subshell Variable Modification

Variable modified in a subshell, potentially losing changes.

Shell Alias Nesting

Shell alias incorrectly nests single quotes, causing syntax errors.

Here-Doc Termination Linefeed

Insert a linefeed between here-document end token and closing parenthesis.

Incorrect Grep Pattern

Using glob syntax instead of regular expressions in grep commands.

Remove indentation before end token

Remove indentation before the end token (or use <<- and indent with tabs).

Incorrect Conditional Syntax

Incorrect use of else if.

Remove Leading Spaces Before Shebang

Eliminate spaces preceding the shebang line.

Unsupported Script Language

Identifying scripts written in languages not supported by ShellCheck.

Missing Dollar Sign

Ensure variables are properly referenced with a '$' sign.

Missing Shebang

Missing exclamation mark in shebang line.

Premature Variable Expansion

Variable expansion occurs before assignment, resulting in unintended values.

Unquoted Variable in Test

Unquoted variables in test expressions causes unexpected script behavior or errors.

Here Document Expansion Control

Quote the 'EOF' delimiter in here documents for remote execution.

Arithmetic Expansion Modernization

Use the modern '$((..))' syntax for arithmetic operations.

Dollar Sign In Assignment

Incorrect use of $ symbol on the left side of variable assignments in shell script.

Unused Variable Detection

Variable appears unused in the script.

Command Substitution Syntax

Use '$(...)' instead of backticks for command substitution.

Parameter Expansion for String Manipulation

Use parameter expansion instead of 'sed' for simple string replacements.