localstack/localstack

View on GitHub
localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py

Summary

Maintainability
F
3 wks
Test Coverage

File ASLParser.py has 6460 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Generated from ASLParser.g4 by ANTLR 4.13.1
# encoding: utf-8
from antlr4 import *
from io import StringIO
import sys
Severity: Major
Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 2 wks to fix

    Keyword_or_stringContext has 130 functions (exceeds 20 allowed). Consider refactoring.
    Open

        class Keyword_or_stringContext(ParserRuleContext):
            __slots__ = 'parser'
    
            def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
                super().__init__(parent, invokingState)
    Severity: Major
    Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 2 days to fix

      ASLParser has 94 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class ASLParser ( Parser ):
      
          grammarFileName = "ASLParser.g4"
      
          atn = ATNDeserializer().deserialize(serializedATN())
      Severity: Major
      Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 1 day to fix

        Comparison_opContext has 44 functions (exceeds 20 allowed). Consider refactoring.
        Open

            class Comparison_opContext(ParserRuleContext):
                __slots__ = 'parser'
        
                def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
                    super().__init__(parent, invokingState)
        Severity: Minor
        Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 6 hrs to fix

          Function state_stmt has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
          Open

              def state_stmt(self):
          
                  localctx = ASLParser.State_stmtContext(self, self._ctx, self.state)
                  self.enterRule(localctx, 12, self.RULE_state_stmt)
                  try:
          Severity: Minor
          Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 5 hrs to fix

          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

          State_stmtContext has 40 functions (exceeds 20 allowed). Consider refactoring.
          Open

              class State_stmtContext(ParserRuleContext):
                  __slots__ = 'parser'
          
                  def __init__(self, parser, parent:ParserRuleContext=None, invokingState:int=-1):
                      super().__init__(parent, invokingState)
          Severity: Minor
          Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 5 hrs to fix

            Function payload_value_lit has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                def payload_value_lit(self):
            
                    localctx = ASLParser.Payload_value_litContext(self, self._ctx, self.state)
                    self.enterRule(localctx, 82, self.RULE_payload_value_lit)
                    self._la = 0 # Token type
            Severity: Minor
            Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 1 hr to fix

            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 choice_rule has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def choice_rule(self):
            
                    localctx = ASLParser.Choice_ruleContext(self, self._ctx, self.state)
                    self.enterRule(localctx, 90, self.RULE_choice_rule)
                    self._la = 0 # Token type
            Severity: Minor
            Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 1 hr to fix

            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 json_value_decl has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def json_value_decl(self):
            
                    localctx = ASLParser.Json_value_declContext(self, self._ctx, self.state)
                    self.enterRule(localctx, 182, self.RULE_json_value_decl)
                    try:
            Severity: Minor
            Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 1 hr to fix

            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 retrier_stmt has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def retrier_stmt(self):
            
                    localctx = ASLParser.Retrier_stmtContext(self, self._ctx, self.state)
                    self.enterRule(localctx, 148, self.RULE_retrier_stmt)
                    try:
            Severity: Minor
            Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 55 mins to fix

            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 keyword_or_string has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def keyword_or_string(self):
            
                    localctx = ASLParser.Keyword_or_stringContext(self, self._ctx, self.state)
                    self.enterRule(localctx, 184, self.RULE_keyword_or_string)
                    self._la = 0 # Token type
            Severity: Minor
            Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 45 mins to fix

            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

            Consider simplifying this complex logical expression.
            Open

                        if not((((_la) & ~0x3f) == 0 and ((1 << _la) & -17408) != 0) or ((((_la - 64)) & ~0x3f) == 0 and ((1 << (_la - 64)) & -144159168540966913) != 0) or ((((_la - 128)) & ~0x3f) == 0 and ((1 << (_la - 128)) & 2047) != 0)):
                            self._errHandler.recoverInline(self)
                        else:
                            self._errHandler.reportMatch(self)
                            self.consume()
            Severity: Major
            Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 40 mins to fix

              Function top_layer_stmt has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def top_layer_stmt(self):
              
                      localctx = ASLParser.Top_layer_stmtContext(self, self._ctx, self.state)
                      self.enterRule(localctx, 4, self.RULE_top_layer_stmt)
                      try:
              Severity: Minor
              Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 35 mins to fix

              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 reader_config_field has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  def reader_config_field(self):
              
                      localctx = ASLParser.Reader_config_fieldContext(self, self._ctx, self.state)
                      self.enterRule(localctx, 132, self.RULE_reader_config_field)
                      try:
              Severity: Minor
              Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 35 mins to fix

              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 comparison_composite has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def comparison_composite(self):
              
                      localctx = ASLParser.Comparison_compositeContext(self, self._ctx, self.state)
                      self.enterRule(localctx, 96, self.RULE_comparison_composite)
                      self._la = 0 # Token type
              Severity: Minor
              Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 25 mins to fix

              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 iterator_decl_item has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def iterator_decl_item(self):
              
                      localctx = ASLParser.Iterator_decl_itemContext(self, self._ctx, self.state)
                      self.enterRule(localctx, 122, self.RULE_iterator_decl_item)
                      try:
              Severity: Minor
              Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 25 mins to fix

              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 catcher_stmt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def catcher_stmt(self):
              
                      localctx = ASLParser.Catcher_stmtContext(self, self._ctx, self.state)
                      self.enterRule(localctx, 166, self.RULE_catcher_stmt)
                      try:
              Severity: Minor
              Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 25 mins to fix

              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 comparison_variable_stmt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def comparison_variable_stmt(self):
              
                      localctx = ASLParser.Comparison_variable_stmtContext(self, self._ctx, self.state)
                      self.enterRule(localctx, 92, self.RULE_comparison_variable_stmt)
                      try:
              Severity: Minor
              Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 25 mins to fix

              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 item_processor_item has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def item_processor_item(self):
              
                      localctx = ASLParser.Item_processor_itemContext(self, self._ctx, self.state)
                      self.enterRule(localctx, 106, self.RULE_item_processor_item)
                      try:
              Severity: Minor
              Found in localstack/services/stepfunctions/asl/antlr/runtime/ASLParser.py - About 25 mins to fix

              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

              There are no issues that match your filters.

              Category
              Status