-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Message:File "XXXX" has {0} lines, which is greater than {1} authorized. Split it into smaller files.
-
List of parameters:
-
Default Severity:Major
-
Impact:Low
-
Likelihood:High
-
Legacy Key:Web:FileLengthCheck, FileLoc, S00104
-
Targeted languages:Flex, PL/I
-
Covered Languages:ABAP, APEX, C#, C, C++, Go, HTML, Java, JavaScript, Kotlin, Objective-C, PHP, PL/SQL, Python, RPG, Ruby, Scala, Swift, T-SQL, TypeScript, VB.Net, VB6
-
Irrelevant for Languages:Cobol, XML
-
Remediation Function:Constant/Issue
-
Constant Cost:1h
-
Analysis Level:Syntactic Analysis
-
Analysis Scope:Main Sources, Test Sources
-
Common Rule:Yes
-
Checkstyle:FileLength
-
ESLint:max-lines
-
Pylint:C0302
-
SwiftLint:file_length
-
TSLint:max-file-line-count
A source file that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor it into smaller pieces of code which focus on well defined tasks. Those smaller files will not only be easier to understand but also probably easier to test.
- is implemented by
-
SONARFLEX-96 Rule: Files should not have too many lines of code
-
- Open
-
-
SONARPLI-155 Rule: Files should not have too many lines of code
-
- Open
-
-
SLVS-1037 Add file length rule
-
- Closed
-
-
SONARPLSQL-667 Rule S104: Files should not have too many lines of code
-
- Closed
-
-
SONARRPG-10 Rule "Files should not have too many lines"
-
- Closed
-
-
SONARSLANG-38 Rule S104: Files should not have too many lines of code
-
- Closed
-
-
SONARSLANG-193 [Scala] Enable Rule: S104 Files should not have too many lines of code
-
- Closed
-
-
SONARSLANG-261 [Apex] Enable Rule: S104 Files should not have too many lines of code
-
- Closed
-
-
SONARSWIFT-67 Rule: Files should not have too many lines
-
- Closed
-
-
SONARTSQL-93 Rule S104: Files should not have too many lines of code
-
- Closed
-
-
SONARVBSIX-226 Rule: Files should not have too many lines of code
-
- Closed
-
-
CPP-707 Create Objective-C rules repository containing targeted rules
-
- Closed
-
-
SONARABAP-167 Update title and description of rule "Avoid too large programs / reports"
-
- Closed
-
- is related to
-
SONARHTML-38 Rule (FileLengthCheck) update default parameter value
-
- Closed
-
-
CPP-394 Rule "Files should not have too many lines" should work on file lines rather than on lines of code
-
- Closed
-
-
SONARVB-120 Rule "Files should not have too many lines" should work on lines and no more on lines of code
-
- Closed
-
- links to
1.
|
C-Family | RSPEC-2897 |
|
Active | Unassigned | |
2.
|
VB.NET | RSPEC-3096 |
|
Active | Unassigned | |
3.
|
JavaScript | RSPEC-3537 |
|
Active | Unassigned | |
4.
|
HTML: Files should not have too many lines | RSPEC-4537 |
|
Active | Unassigned | |
5.
|
RPG: Files should not have too many lines | RSPEC-4546 |
|
Active | Unassigned | |
6.
|
Go | RSPEC-4598 |
|
Active | Unassigned | |
7.
|
VB6 | RSPEC-6037 |
|
Active | Unassigned |