Showing 39 of 109 total issues
TypeScriptParserBaseListener
has 424 methods (exceeds 20 allowed). Consider refactoring. Open
public class TypeScriptParserBaseListener implements TypeScriptParserListener {
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
TypeScriptParserListener
has 420 methods (exceeds 20 allowed). Consider refactoring. Open
public interface TypeScriptParserListener extends ParseTreeListener {
/**
* Enter a parse tree produced by {@link TypeScriptParser#initializer}.
* @param ctx the parse tree
*/
PythonParserBaseListener
has 160 methods (exceeds 20 allowed). Consider refactoring. Open
public class PythonParserBaseListener implements PythonParserListener {
/**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
PythonParserListener
has 156 methods (exceeds 20 allowed). Consider refactoring. Open
public interface PythonParserListener extends ParseTreeListener {
/**
* Enter a parse tree produced by {@link PythonParser#root}.
* @param ctx the parse tree
*/
File TypeScriptParserBaseListener.java
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Generated from TypeScriptParser.g4 by ANTLR 4.7.2
package tsantlr;
import org.antlr.v4.runtime.ParserRuleContext;
import org.antlr.v4.runtime.tree.ErrorNode;
File TypeScriptParserListener.java
has 424 lines of code (exceeds 250 allowed). Consider refactoring. Open
// Generated from TypeScriptParser.g4 by ANTLR 4.7.2
package tsantlr;
import org.antlr.v4.runtime.tree.ParseTreeListener;
JavaFullListener
has 25 methods (exceeds 20 allowed). Consider refactoring. Open
type JavaFullListener struct {
parser.BaseJavaParserListener
}
Function startParse
has a Cognitive Complexity of 33 (exceeds 20 allowed). Consider refactoring. Open
func startParse(nodes []core_domain.CodeDataStruct, relates []support.RefactorChangeRelate) {
for _, pkgNode := range nodes {
for _, related := range relates {
oldInfo := support.BuildMethodPackageInfo(related.OldObj)
newInfo := support.BuildMethodPackageInfo(related.NewObj)
- 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 ParseXML
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
func ParseXML(r io.Reader) *XMLNode {
parser := xml.NewDecoder(r)
var root XMLNode
st := container.NewStack()
- 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 ParseXML
has 69 lines of code (exceeds 50 allowed). Consider refactoring. Open
func ParseXML(r io.Reader) *XMLNode {
parser := xml.NewDecoder(r)
var root XMLNode
st := container.NewStack()
Method TbsApp.AnalysisPath
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func (a TbsApp) AnalysisPath(deps []core_domain.CodeDataStruct, identifiersMap map[string]core_domain.CodeDataStruct) []TestBadSmell {
var results []TestBadSmell = nil
callMethodMap := core_domain.BuildCallMethodMap(deps)
for _, clz := range deps {
for _, method := range clz.Functions {
- 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 CocagoParser.Visitor
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (n *CocagoParser) Visitor(f *ast.File, fset *token.FileSet, fileName string) *core_domain.CodeContainer {
var currentStruct core_domain.CodeDataStruct
var currentFile core_domain.CodeContainer
var currentFunc *core_domain.CodeFunction
var dsMap = make(map[string]*core_domain.CodeDataStruct)
Method testTryStmt
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Test
void testTryStmt() {
String s = "# try_stmt: TRY COLON suite (except_clause+ else_clause? finaly_clause? | finaly_clause)\n" +
"\n" +
"# TRY COLON suite except_clause\n" +
Function Test_ShouldBuildSuccessDataFromSourceData
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
func Test_ShouldBuildSuccessDataFromSourceData(t *testing.T) {
g := NewGomegaWithT(t)
codePath := "../../../_fixtures/grammar/java/examples/api"
callNodes, identifiersMap, identifiers := testhelper.BuildAnalysisDeps(codePath)
Method nextToken
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@Override
public Token nextToken() {
// Check if the end-of-file is ahead and there are still some DEDENTS expected.
if (_input.LA(1) == EOF && _indents.size() > 0)
{
- 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 testStar
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Test
void testStar() {
String s = "# argument\n" +
"# : test (comp_for | ASSIGN test)?\n" +
"# | (POWER | STAR) test\n" +
Method HandleSpaces
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected void HandleSpaces() {
char next = (char) _input.LA(1);
if ((_lastToken == null || _lastToken.getType() == PythonLexer.NEWLINE) && IsNotNewLineOrComment(next))
{
- 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 BuildDeps
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
func BuildDeps(val xmlparse.XMLNode) []core_domain.CodeDependency {
var deps []core_domain.CodeDependency = nil
for _, depElement := range val.Elements {
depNode := depElement.Val.(xmlparse.XMLNode)
dependency := core_domain.NewCodeDependency("", "")
- 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 BuildMethodCallExprStmt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
func BuildMethodCallExprStmt(it *ast.ExprStmt, codeFunc *CodeFunction, fields []CodeField, imports []CodeImport, currentPackage string, localVars []CodeProperty) {
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"