Showing 39 of 109 total issues
Method ProcessStringLiteral
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected void ProcessStringLiteral()
{
if (lastToken == null || lastToken.getType() == TypeScriptLexer.OpenBrace)
{
String text = getText();
- 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
Function BuildMethodCall
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func BuildMethodCall(codeFunc *CodeFunction, item ast.Stmt, fields []CodeField, localVars []CodeProperty, imports []CodeImport, packageName string) ([]CodeProperty, CodeCall) {
Function GetFilesWithFilter
has 6 return statements (exceeds 4 allowed). Open
func GetFilesWithFilter(codeDir string, filter func(path string) bool) []string {
files := make([]string, 0)
gitIgnore, err := ignore.CompileIgnoreFile(filepath.FromSlash(codeDir + "/.gitignore"))
if err != nil {
fmt.Println(err)
Function WarpTargetFullType
has 6 return statements (exceeds 4 allowed). Open
func WarpTargetFullType(targetType string) (string, string) {
callType := ""
if strings.EqualFold(currentClz, targetType) {
callType = "self"
return currentPkg + "." + targetType, callType
Method FullGraph.buildGraphNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func (fullGraph *FullGraph) buildGraphNode(subgraph string, current *PathTrie, graph *gographviz.Graph, nodes map[string]string, s string) {
Function checkAssert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func checkAssert(hasAssert bool, filePath string, method core_domain.CodeFunction, results *[]TestBadSmell, testType *string) {
Function CommonAnalysis
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func CommonAnalysis(output io.Writer, path string, app app_concept.AbstractAnalysisApp, filter func(path string) bool, isFunctionBase bool) []core_domain.CodeDataStruct {
Function checkDuplicateAssertTest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func checkDuplicateAssertTest(clz core_domain.CodeDataStruct, results *[]TestBadSmell, methodCallMap map[string][]core_domain.CodeCall, method core_domain.CodeFunction, testType *string) {
Function checkSleepyTest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func checkSleepyTest(path string, call core_domain.CodeCall, jMethod core_domain.CodeFunction, results *[]TestBadSmell, testType *string) {
Function checkRedundantAssertionTest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func checkRedundantAssertionTest(path string, call core_domain.CodeCall, method core_domain.CodeFunction, results *[]TestBadSmell, testType *string) {
Function checkEmptyTest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
func checkEmptyTest(path string, annotation core_domain.CodeAnnotation, results *[]TestBadSmell, method core_domain.CodeFunction, testType *string) {
Function warpTargetFullType
has 5 return statements (exceeds 4 allowed). Open
func warpTargetFullType(targetType string) string {
if strings.EqualFold(currentClz, targetType) {
return currentPkg + "." + targetType
}
Function CopyFile
has 5 return statements (exceeds 4 allowed). Open
func CopyFile(src, dst string) (int64, error) {
sourceFileStat, err := os.Stat(src)
if err != nil {
return 0, err
}
Function compare
has 5 return statements (exceeds 4 allowed). Open
func compare(actual []byte, filename string) error {
if err := update(filename, actual); err != nil {
return err
}
Function BuildExpr
has 5 return statements (exceeds 4 allowed). Open
func BuildExpr(expr ast.Expr) (string, string, string) {
switch x := expr.(type) {
case *ast.SelectorExpr:
selector := ""
switch sele := x.X.(type) {
Function SegmentCamelcase
has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring. Open
func SegmentCamelcase(methodsName []string) map[string]int {
strMap = make(map[string]int)
for _, name := range methodsName {
// get, set
if (strings.HasSuffix("set", name) || strings.HasSuffix("get", name)) && len(name) > 3 {
- 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 ProcessNewLine
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private void ProcessNewLine(int indent) {
emit(PythonLexer.LINE_BREAK);
int previous = _indents.size() == 0 ? 0 : _indents.peek();
- 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 JavaAPIListener.EnterAnnotation
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (s *JavaAPIListener) EnterAnnotation(ctx *parser.AnnotationContext) {
if ctx.QualifiedName() == nil {
return
}
- 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 lineTerminatorAhead
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected boolean lineTerminatorAhead() {
// Get the token ahead of the current index.
int possibleIndexEosToken = this.getCurrentToken().getTokenIndex() - 1;
Token ahead = _input.get(possibleIndexEosToken);
- 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"