StoryScriptorg/StoryScript

View on GitHub

Showing 99 of 110 total issues

File lexer.py has 846 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import numpy as np
# I tried to convince DeepSource that all of the objects existed
from .langData import Exceptions, LambdaExpr, BASE_KEYWORDS, PRIMITIVE_TYPE, Types, mismatch_type, LISTDECLARE_KEYW, PythonFunctionObject, invalid_value, Array, not_enough_args_for_import_statement
from typing import NoReturn
from .langParser import Parser
Severity: Major
Found in storyscript/lexer.py - About 2 days to fix

    File langParser.py has 336 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    from string import ascii_letters, digits
    from .langData import Types, Exceptions, ConditionType, Array, LambdaExpr
    from storyscript_mathparse.mathProcessor import process as processmath
    from storyscript_mathparse import values
    from . import executor
    Severity: Minor
    Found in storyscript/langParser.py - About 4 hrs to fix

      Function test_arithmatics has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def test_arithmatics(self):
              self.assertEqual(processor.execute("// Arithmatics test"), None)
              self.assertEqual(processor.execute("5 + 5 * 0"), 5)
              self.assertEqual(processor.execute("10 + 20 * 2"), 50)
              self.assertEqual(processor.execute("2 ** 2"), 4)  # (Exponentiation)
      Severity: Minor
      Found in tests.py - About 1 hr to fix

        Function test_other has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def test_other(self):
                processor.syntax_highlighting("")
                processor.syntax_highlighting("\"Hello, world!\"")
                processor.syntax_highlighting("int a = 10 + 10")
                self.assertEqual(str(values.Number(5)), "5")
        Severity: Minor
        Found in tests.py - About 1 hr to fix

          Avoid deeply nested control flow statements.
          Open

                                      if STORYSCRIPT_INTERPRETER_DEBUG_MODE:
                                          print(f"[DEBUG] Application exited with code: {code}")
                                      return True
          Severity: Major
          Found in storyscript/processor.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if commands[0] == "BREAKPOINT":
                                            commands = commands[1:]
                                    else:
            Severity: Major
            Found in storyscript/processor.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if is_in_else_block:
                                          ifstatement["else"] = commands
                                      else:
                                          ifstatement["if"] = commands
                                      is_in_else_block = False
              Severity: Major
              Found in storyscript/lexer.py - About 45 mins to fix

                Avoid too many return statements within this function.
                Open

                            return f"InvalidSyntax: {e}", Exceptions.InvalidSyntax
                Severity: Major
                Found in storyscript/langParser.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return f"NotDefinedException: {e}", Exceptions.NotDefinedException
                  Severity: Major
                  Found in storyscript/langParser.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return None, None
                    Severity: Major
                    Found in storyscript/lexer.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return (
                      Severity: Major
                      Found in storyscript/lexer.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return self.switch_case_statement(tc)
                        Severity: Major
                        Found in storyscript/lexer.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return len(self.symbol_table.GetVariable(functioncall[0])[1].data), None
                          Severity: Major
                          Found in storyscript/lexer.py - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return self.handle_function(functioncall, original_text)
                            Severity: Major
                            Found in storyscript/lexer.py - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return Types.String
                              Severity: Major
                              Found in storyscript/langParser.py - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                            return nodes.MinusNode(self.factor())
                                Severity: Major
                                Found in storyscript_mathparse/mathParser.py - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              return f"InvalidTypeException: {e}", Exceptions.InvalidTypeException
                                  Severity: Major
                                  Found in storyscript/langParser.py - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                            return Types.Float
                                    Severity: Major
                                    Found in storyscript/langParser.py - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                                      return None, None
                                      Severity: Major
                                      Found in storyscript/lexer.py - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    return self.parse_lambda_expression(tc)
                                        Severity: Major
                                        Found in storyscript/lexer.py - About 30 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language