-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Message:Move this trailing comment on the previous empty line.
-
List of parameters:
-
Default Severity:Minor
-
Impact:Low
-
Likelihood:Low
-
Legacy Key:trailing-comment, TrailingCommentCheck, TrailingComment
-
Targeted languages:C#, Flex
-
Covered Languages:C, C++, Java, JavaScript, Objective-C, PHP, PL/SQL, Python, Swift, VB.Net, VB6
-
Remediation Function:Constant/Issue
-
Constant Cost:1min
-
Analysis Scope:Main Sources, Test Sources
-
Checkstyle:TrailingComment
-
ESLint:no-inline-comment
This rule verifies that single-line comments are not located at the ends of lines of code. The main idea behind this rule is that in order to be really readable, trailing comments would have to be properly written and formatted (correct alignment, no interference with the visual structure of the code, not too long to be visible) but most often, automatic code formatters would not handle this correctly: the code would end up less readable. Comments are far better placed on the previous empty line of code, where they will always be visible and properly formatted.
- is implemented by
-
CPP-589 Rule: Comments should not be located at the end of lines of code
-
- Closed
-
-
SLVS-1011 Add comment at line end rule
-
- Closed
-
-
SONARSWIFT-52 Rule: Comments should not be located at the end of lines of code
-
- Closed
-
-
SONARVBSIX-158 Rule: Comments should not be located at the end of lines of code
-
- Closed
-
-
CPP-707 Create Objective-C rules repository containing targeted rules
-
- Closed
-
-
SONARPLSQL-498 Rule: Comments should not be located at the end of lines of code
-
- Closed
-
- is related to
-
CPP-2381 S139: Fix false-positive with comments after curly braces and preprocessor directives
-
- Closed
-
- relates to
-
RSPEC-906 Before preprocessing, a null statement shall only occur on a line by itself; it may be followed by a comment provided that the first character following the null statement is a white-space character
- Closed
- links to
1.
|
VB.NET | RSPEC-2300 |
|
Active | Unassigned | |
2.
|
Swift | RSPEC-2507 |
|
Active | Unassigned | |
3.
|
C-Family | RSPEC-2896 |
|
Active | Unassigned | |
4.
|
Java | RSPEC-3150 |
|
Active | Unassigned | |
5.
|
JavaScript | RSPEC-3151 |
|
Active | Unassigned | |
6.
|
PHP | RSPEC-3152 |
|
Active | Unassigned | |
7.
|
PL/SQL | RSPEC-3153 |
|
Active | Unassigned | |
8.
|
VB6 | RSPEC-3154 |
|
Active | Unassigned | |
9.
|
Python | RSPEC-4008 |
|
Active | Unassigned |