src/main/java/com/sleekbyte/tailor/Tailor.java
File Tailor.java
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package com.sleekbyte.tailor;
import com.sleekbyte.tailor.antlr.SwiftBaseListener;
import com.sleekbyte.tailor.antlr.SwiftLexer;
import com.sleekbyte.tailor.antlr.SwiftParser;
Method analyzeFiles
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void analyzeFiles(Set<String> fileNames) throws CLIArgumentParserException, IOException {
ColorSettings colorSettings =
new ColorSettings(configuration.shouldColorOutput(), configuration.shouldInvertColorOutput());
Formatter formatter = configuration.getFormatter(colorSettings);
Severity maxSeverity = configuration.getMaxSeverity();
Method main
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static void main(String[] args) {
Tailor tailor = new Tailor();
try {
tailor.configuration = new Configuration(args);
Method createListeners
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
private List<SwiftBaseListener> createListeners(Set<Rules> enabledRules,
Printer printer,
CommonTokenStream tokenStream,
ConstructLengths constructLengths,
CommentExtractor commentExtractor)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method createListeners
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private List<SwiftBaseListener> createListeners(Set<Rules> enabledRules,
Printer printer,
CommonTokenStream tokenStream,
ConstructLengths constructLengths,
CommentExtractor commentExtractor)
Method analyzeFile
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void analyzeFile(File inputFile,
Optional<CommonTokenStream> optTokenStream,
Optional<TopLevelContext> optTree,
Formatter formatter,
Severity maxSeverity,
Method main
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
Open
public static void main(String[] args) {
Tailor tailor = new Tailor();
try {
tailor.configuration = new Configuration(args);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method analyzeFile
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private void analyzeFile(File inputFile,
Optional<CommonTokenStream> optTokenStream,
Optional<TopLevelContext> optTree,
Formatter formatter,
Severity maxSeverity,
Method createListeners
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private List<SwiftBaseListener> createListeners(Set<Rules> enabledRules,
Printer printer,
CommonTokenStream tokenStream,
ConstructLengths constructLengths,
CommentExtractor commentExtractor)