Showing 99 of 110 total issues
File lexer.py
has 846 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
File langParser.py
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
Function test_arithmatics
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
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)
Function test_other
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
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")
Avoid deeply nested control flow statements. Open
Open
if STORYSCRIPT_INTERPRETER_DEBUG_MODE:
print(f"[DEBUG] Application exited with code: {code}")
return True
Avoid deeply nested control flow statements. Open
Open
if commands[0] == "BREAKPOINT":
commands = commands[1:]
else:
Avoid deeply nested control flow statements. Open
Open
if is_in_else_block:
ifstatement["else"] = commands
else:
ifstatement["if"] = commands
is_in_else_block = False
Avoid too many return
statements within this function. Open
Open
return f"InvalidSyntax: {e}", Exceptions.InvalidSyntax
Avoid too many return
statements within this function. Open
Open
return f"NotDefinedException: {e}", Exceptions.NotDefinedException
Avoid too many return
statements within this function. Open
Open
return None, None
Avoid too many return
statements within this function. Open
Open
return (
Avoid too many return
statements within this function. Open
Open
return self.switch_case_statement(tc)
Avoid too many return
statements within this function. Open
Open
return len(self.symbol_table.GetVariable(functioncall[0])[1].data), None
Avoid too many return
statements within this function. Open
Open
return self.handle_function(functioncall, original_text)
Avoid too many return
statements within this function. Open
Open
return Types.String
Avoid too many return
statements within this function. Open
Open
return nodes.MinusNode(self.factor())
Avoid too many return
statements within this function. Open
Open
return f"InvalidTypeException: {e}", Exceptions.InvalidTypeException
Avoid too many return
statements within this function. Open
Open
return Types.Float
Avoid too many return
statements within this function. Open
Open
return None, None
Avoid too many return
statements within this function. Open
Open
return self.parse_lambda_expression(tc)