Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Walkthrough이번 변경은 도메인 기반 계산기 및 수식 평가 시스템의 전체 아키텍처와 핵심 도메인 객체, 정책, 명세, 서비스, 값 객체, 예외, 팩토리, 인터페이스, 빌더, AST(추상 구문 트리) 노드 및 최적화/트래버설, 평가자, 수식 처리 등 모든 레이어의 코드를 대규모로 신규 도입합니다. 또한 Git pre-commit/build 훅의 추가/삭제가 있습니다. Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant Calculator
participant ValidationService
participant CalculatorService
participant ASTNodeFactory
participant LRParser
participant ExpressionEvaluator
User->>Calculator: calculate(request)
Calculator->>ValidationService: validateCalculationRequest(request)
ValidationService-->>Calculator: (validation pass/fail)
Calculator->>CalculatorService: calculate(request)
CalculatorService->>ASTNodeFactory: create AST from formula
ASTNodeFactory-->>CalculatorService: ASTNode
CalculatorService->>LRParser: parse tokens to AST
LRParser-->>CalculatorService: ASTNode
CalculatorService->>ExpressionEvaluator: evaluate(ASTNode, variables)
ExpressionEvaluator-->>CalculatorService: result
CalculatorService-->>Calculator: CalculationResult
Calculator-->>User: CalculationResult
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120+ minutes
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 93
♻️ Duplicate comments (2)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationResult.kt (1)
271-292: 수동 JSON 생성의 보안 취약점
CalculationRequest와 동일한 문제가 있습니다. 수동 JSON 생성은 보안 취약점을 만들 수 있습니다.JSON 라이브러리를 사용하여 안전하게 직렬화하세요:
fun toJson(): String { val data = mapOf( "result" to asString(), "executionTimeMs" to executionTimeMs, "formula" to formula, "variables" to variables, "steps" to steps, "errors" to errors, "warnings" to warnings, "isSuccess" to isSuccess() ) return objectMapper.writeValueAsString(data) }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationStep.kt (1)
111-117: 중복된 예약어 목록 관리
CalculationRequest와 마찬가지로 예약어 목록이 하드코딩되어 있습니다. 여러 클래스에서 비슷한 목록을 관리하는 것은 일관성 문제를 일으킬 수 있습니다.모든 예약어와 함수 목록을 중앙화하여 관리하세요:
object ReservedKeywords { val MATH_FUNCTIONS = setOf("sin", "cos", "tan", ...) val AGGREGATE_FUNCTIONS = setOf("sum", "avg", ...) val RESERVED_WORDS = setOf("if", "true", "false", ...) val ALL_RESERVED = MATH_FUNCTIONS + AGGREGATE_FUNCTIONS + RESERVED_WORDS }
🧹 Nitpick comments (51)
.github/hooks/pre-push (2)
2-2: 경로 불일치 수정 필요주석에는
.git/hooks/pre-push라고 되어 있지만, 실제 파일 위치는.github/hooks/pre-push입니다. Git 훅이 동작하려면.git/hooks/디렉토리에 복사되어야 하므로 주석을 현재 파일 위치에 맞게 수정하거나 설치 방법을 문서화해야 합니다.-# .git/hooks/pre-push +# .github/hooks/pre-push (Copy to .git/hooks/pre-push to activate)
12-12: 파일 끝에 개행 문자 추가 필요Unix 표준에 따라 파일 끝에 개행 문자가 있어야 합니다.
echo "✅ 빌드 성공—푸시 진행" +casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/exceptions/CalculatorException.kt (1)
94-100: 매직 넘버를 상수로 추출하세요수식 문자열을 자르는 길이(50)가 하드코딩되어 있습니다. 유지보수성을 위해 상수로 추출하는 것이 좋겠습니다.
companion object { + private const val FORMULA_PREVIEW_LENGTH = 50 + /** * Calculator 오류 메시지를 구성합니다. ... fun formulaTooLong(formula: String, maxLength: Int): CalculatorException { return CalculatorException( errorCode = ErrorCode.FORMULA_TOO_LONG, - formula = formula.take(50) + if (formula.length > 50) "..." else "", + formula = formula.take(FORMULA_PREVIEW_LENGTH) + if (formula.length > FORMULA_PREVIEW_LENGTH) "..." else "", maxAllowed = maxLength ) }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/EvaluationResult.kt (1)
113-121: 복잡도 임계값을 상수로 정의하세요복잡도 레벨을 결정하는 매직 넘버들(5, 15, 30)을 상수로 추출하면 유지보수성이 향상됩니다.
+ companion object { + private const val LOW_COMPLEXITY_THRESHOLD = 5 + private const val MEDIUM_COMPLEXITY_THRESHOLD = 15 + private const val HIGH_COMPLEXITY_THRESHOLD = 30 + /** * 성공 결과를 생성합니다. ... private fun calculateComplexity(): ComplexityLevel { val totalOperations = variablesUsed.size + functionsUsed.size return when { - totalOperations <= 5 -> ComplexityLevel.LOW - totalOperations <= 15 -> ComplexityLevel.MEDIUM - totalOperations <= 30 -> ComplexityLevel.HIGH + totalOperations <= LOW_COMPLEXITY_THRESHOLD -> ComplexityLevel.LOW + totalOperations <= MEDIUM_COMPLEXITY_THRESHOLD -> ComplexityLevel.MEDIUM + totalOperations <= HIGH_COMPLEXITY_THRESHOLD -> ComplexityLevel.HIGH else -> ComplexityLevel.VERY_HIGH } }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/EvaluationPolicy.kt (1)
112-118: 메모리 추정 계수를 상수로 정의하세요메모리 사용량 추정에 사용되는 매직 넘버(0.1, 0.05)를 상수로 추출하면 향후 조정이 용이해집니다.
companion object { private const val DEFAULT_MAX_DEPTH = 100 private const val DEFAULT_MAX_NODES = 10000 private const val DEFAULT_MAX_VARIABLES = 1000 private const val DEFAULT_MAX_EXECUTION_TIME_MS = 30000L private const val DEFAULT_MAX_MEMORY_MB = 100 + private const val MEMORY_PER_NODE_MB = 0.1 + private const val MEMORY_PER_VARIABLE_MB = 0.05 ... fun estimateMemoryUsage(node: ASTNode, context: EvaluationContext): Double { val nodeCount = countNodes(node) val variableCount = context.getVariableCount() - val baseMemory = (nodeCount * 0.1) + (variableCount * 0.05) // 매우 간단한 추정 + val baseMemory = (nodeCount * MEMORY_PER_NODE_MB) + (variableCount * MEMORY_PER_VARIABLE_MB) return baseMemory }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/IfBuilder.kt (1)
28-36: IF 노드 빌드 로직이 올바르게 구현되었습니다.8개의 자식 요소에서 인덱스 2, 4, 6에 위치한
ASTNode들을 조건, 참값, 거짓값으로 적절히 추출하여IfNode를 생성합니다.파서 구조를 더 명확히 하기 위해 주석에 예상되는 구조를 추가하는 것을 제안합니다:
/** * IF 조건문 빌더 - IF 노드를 생성합니다. * * IF(조건, 참값, 거짓값) 형태의 조건문을 처리합니다. - * 예: IF ( EXPR , EXPR , EXPR ) -> If + * 예: IF ( EXPR , EXPR , EXPR ) -> If + * 파서 구조: [0]IF [1]( [2]condition [3], [4]trueValue [5], [6]falseValue [7]) * * @author kangeunchan * @since 2025.07.31 */casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/ParenthesizedBuilder.kt (1)
32-34: 검증 로직을 완성하세요.현재 검증에서 괄호에 해당하는 첫 번째와 세 번째 자식에 대한 검증이 누락되었습니다.
괄호 토큰 검증을 추가하여 더 엄격한 검증을 수행할 수 있습니다:
override fun validateChildren(children: List<Any>): Boolean { - return children.size == 3 && children[1] is ASTNode + return children.size == 3 && + children[0] != null && // 좌괄호 + children[1] is ASTNode && // 표현식 + children[2] != null // 우괄호 }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/ArgsMultipleBuilder.kt (2)
27-35: 중간 자식 요소 처리에 대한 명확화가 필요합니다.
children[1]이 무시되고 있는데, 이것이 쉼표 구분자를 의미하는 것인지 문서화가 필요합니다. 또한validateChildren에서도 이 요소에 대한 검증이 없습니다.다음과 같은 개선을 제안합니다:
/** * 다중 인수 빌더 - 기존 인수 목록에 새 인수를 추가합니다. * * 기존 인수 목록과 새로운 인수를 결합하여 확장된 인수 목록을 생성합니다. - * 예: ARGS , EXPR -> Args + * 예: ARGS , EXPR -> Args (중간 요소는 쉼표 구분자로 무시됨) * * @author kangeunchan * @since 2025.07.31 */
37-42: 검증 로직의 일관성을 개선하세요.
build메서드에서children[1]을 무시하지만,validateChildren에서는 이에 대한 검증이 없습니다. 일관성을 위해 중간 요소에 대한 검증도 추가하는 것을 고려해보세요.override fun validateChildren(children: List<Any>): Boolean { return children.size == 3 && children[0] is List<*> && (children[0] as List<*>).all { it is ASTNode } && + // children[1]은 구분자로 검증 생략 가능 children[2] is ASTNode }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/ASTBuilderContract.kt (1)
72-72: 리플렉션 사용 시 성능 고려
getBuilderName()메서드에서 리플렉션을 사용하는데, 자주 호출되는 경우 성능에 영향을 줄 수 있습니다.구현 클래스에서 이 메서드를 오버라이드하여 하드코딩된 이름을 반환하는 것을 고려하세요:
override fun getBuilderName(): String = "BinaryOpBuilder"casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/ASTNode.kt (1)
22-22: 각 AST 노드마다 UUID 생성은 성능에 영향을 줄 수 있습니다모든 AST 노드 인스턴스마다 UUID를 생성하는 것은 파싱 시 많은 노드가 생성될 때 성능 병목이 될 수 있습니다. 다음 대안을 고려해보세요:
- 카운터 기반 ID 사용
- ID가 꼭 필요한 경우에만 lazy 초기화
- 더 가벼운 ID 생성 메커니즘 사용
- private val id: String = java.util.UUID.randomUUID().toString() + private val id: String by lazy { java.util.UUID.randomUUID().toString() }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/services/MathFunctionService.kt (2)
57-119: executeFunction 메서드의 when 표현식이 너무 깁니다60줄이 넘는 when 표현식은 유지보수가 어렵습니다. 함수 맵을 사용한 리팩토링을 고려해보세요.
private val functionMap: Map<String, (List<Any?>) -> Any?> = mapOf( "ABS" to ::executeAbs, "SQRT" to ::executeSqrt, // ... 나머지 함수들 ) fun executeFunction(functionName: String, arguments: List<Any?>): Any? { val funcName = functionName.uppercase() val function = functionMap[funcName] ?: throw EvaluatorException.unsupportedFunction(funcName) return function(arguments) }
378-389: 팩토리얼 구현에서 정밀도 손실 가능성Double을 사용한 팩토리얼 계산은 큰 수에서 정밀도를 잃을 수 있습니다. 특히 170! 이전에도 정확한 값을 보장할 수 없습니다.
정확한 계산이 필요한 경우 BigInteger 사용을 고려하거나, 정밀도 손실에 대한 문서화를 추가하세요.
/** * 팩토리얼 함수를 실행합니다. * 주의: Double 타입 제한으로 인해 큰 수에서는 근사값이 반환될 수 있습니다. */casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/TreeDepth.kt (1)
195-199: 평균 계산 시 정밀도 손실
toInt()는 소수점을 버리므로 정밀도가 손실됩니다. 트리 깊이의 평균을 더 정확하게 표현하려면 반올림을 사용하는 것이 좋습니다.fun average(depths: List<TreeDepth>): TreeDepth { if (depths.isEmpty()) return ZERO - val avg = depths.map { it.value }.average().toInt() + val avg = depths.map { it.value }.average().roundToInt() return of(avg) }필요한 import 추가:
import kotlin.math.roundToIntcasper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/exceptions/ASTException.kt (1)
158-167: 더 간결한 Kotlin 스타일로 개선 가능현재 구현도 동작하지만, Kotlin의 map 연산을 활용하면 더 간결하게 작성할 수 있습니다.
fun getFullErrorInfo(): Map<String, String> { - val baseInfo = super.toErrorInfo().toMutableMap() - val astInfo = getASTInfo() - - astInfo.forEach { (key, value) -> - baseInfo[key] = value.toString() - } - - return baseInfo + return super.toErrorInfo() + getASTInfo().mapValues { it.value.toString() } }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/specifications/ASTValiditySpec.kt (2)
89-93: 검증 순서 최적화 가능
isNaN()체크는isFinite()체크에 포함되므로 중복입니다. NaN은 finite하지 않기 때문입니다.private fun isValidNumberNode(node: NumberNode): Boolean { - return node.value.isFinite() && - !node.value.isNaN() && + return node.value.isFinite() && node.value >= MIN_NUMBER_VALUE && node.value <= MAX_NUMBER_VALUE }
434-439: 예약어 목록 재검토 필요현재 예약어 목록에 JavaScript 특화 키워드(
typeof,instanceof,undefined등)가 포함되어 있습니다. 수식 평가 도메인에 맞는 예약어만 남기는 것이 좋습니다.casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/MathFunctionFactory.kt (1)
486-501: 표준편차와 분산 계산 방식 명시 필요현재 구현은 모집단 표준편차/분산을 계산합니다. 표본 표준편차/분산(n-1로 나누기)도 지원하거나, 최소한 문서에 명시해야 합니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/policies/ASTValidationPolicy.kt (1)
49-51: 문법 수정 필요"최소값을 미만입니다"는 문법적으로 어색합니다.
-violations.add("숫자 값이 최소값을 미만입니다: $value < $MIN_NUMBER_VALUE") +violations.add("숫자 값이 최소값보다 작습니다: $value < $MIN_NUMBER_VALUE")casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/specifications/NodeStructureSpec.kt (1)
3-8: 중복된 import 문을 제거하세요3번 줄에서 이미 와일드카드를 사용해 모든 엔티티를 import하고 있는데, 4-8번 줄에서 다시 개별적으로 import하고 있습니다.
import hs.kr.entrydsm.domain.ast.entities.* -import hs.kr.entrydsm.domain.ast.entities.BinaryOpNode -import hs.kr.entrydsm.domain.ast.entities.FunctionCallNode -import hs.kr.entrydsm.domain.ast.entities.IfNode -import hs.kr.entrydsm.domain.ast.entities.UnaryOpNode -import hs.kr.entrydsm.domain.ast.entities.VariableNodecasper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/CalculatorValiditySpec.kt (1)
239-241: null 값 처리 정책을 명확히 하세요현재 null 값을 무조건 거부하고 있는데, 이는 너무 제한적일 수 있습니다. 일부 계산 시스템에서는 null 값을 허용하는 것이 유용할 수 있습니다.
null 값 허용 여부를 설정 가능하게 만들거나, 최소한 이 정책을 문서화하세요:
private fun isValidVariableValue(value: Any?, allowNull: Boolean = false): Boolean { return when (value) { null -> allowNull // ... 나머지 로직 } }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/services/CalculatorService.kt (1)
9-9: 불필요한 주석을 제거하세요.사용하지 않는 import를 제거했다는 주석은 코드 리뷰나 버전 관리 도구에서 확인할 수 있으므로 소스 코드에 남겨둘 필요가 없습니다.
-// Removed unused EvaluatorException and EvaluationResult importscasper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/ExpressionValiditySpec.kt (2)
92-106: 알 수 없는 노드 타입에 대한 처리가 확장성을 제한합니다.현재 구현은 새로운 노드 타입이 추가될 때마다 이 메서드를 수정해야 합니다.
ASTNode가 sealed class라면 컴파일러가 모든 경우를 처리하도록 강제할 수 있습니다.
ASTNode가 sealed class인 경우, else 블록 대신 모든 하위 타입을 명시적으로 처리하여 컴파일 시점에 누락을 방지할 수 있습니다.
175-186: 복잡도 점수 계산 기준이 명확하지 않습니다.각 노드 타입별 복잡도 점수가 임의적으로 보이며, 이러한 점수를 부여한 근거가 불명확합니다. 또한 알 수 없는 노드에 10점이라는 높은 점수를 부여하는 것도 의문스럽습니다.
복잡도 점수를 상수로 정의하고 그 근거를 문서화하는 것이 좋습니다:
companion object { // 복잡도 점수 정의 private const val LITERAL_COMPLEXITY = 1 // 리터럴은 가장 단순 private const val UNARY_OP_COMPLEXITY = 2 // 단항 연산 private const val BINARY_OP_COMPLEXITY = 3 // 이항 연산 private const val FUNCTION_CALL_COMPLEXITY = 5 // 함수 호출 private const val CONDITIONAL_COMPLEXITY = 7 // 조건문 (분기 복잡도) private const val UNKNOWN_NODE_COMPLEXITY = 1 // 알 수 없는 노드는 보수적으로 처리 }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/services/TreeOptimizer.kt (1)
31-34: 의존성을 직접 생성하는 대신 주입받는 것이 좋습니다.현재
ASTNodeFactory와TreeTraverser를 직접 생성하고 있어 테스트 가능성이 떨어지고 결합도가 높습니다.생성자를 통한 의존성 주입을 사용하세요:
class TreeOptimizer( + private val factory: ASTNodeFactory = ASTNodeFactory(), + private val traverser: TreeTraverser = TreeTraverser() ) { - - private val factory = ASTNodeFactory() - private val traverser = TreeTraverser()casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/BooleanNode.kt (1)
157-161: 입력 검증이 적절히 구현되었습니다.대소문자를 구분하지 않는 파싱과 적절한 예외 처리가 잘 구현되었습니다.
향후 다국어 지원이 필요한 경우, 메시지를 리소스 파일로 분리하는 것을 고려해보세요.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/services/TreeTraverser.kt (2)
40-60: 중위 순회가 이진 트리가 아닌 경우를 제대로 처리하지 못합니다.현재 구현은 첫 번째 자식 후에 부모를 방문하고 나머지 자식들을 순회하는데, 이는 전통적인 중위 순회와 다릅니다. AST가 이진 트리가 아닐 수 있으므로 이 메서드의 동작이 예상과 다를 수 있습니다.
메서드에 제한사항을 명시하거나, 이진 트리인 경우에만 작동하도록 검증을 추가하세요:
/** * 중위 순회를 수행합니다 (이진 트리에 적합). * * 주의: 이 메서드는 이진 트리 구조에 최적화되어 있으며, * 2개 이상의 자식을 가진 노드의 경우 예상과 다른 순서로 방문할 수 있습니다. * * @param root 순회할 루트 노드 * @param visitor 방문자 */
164-177: 타입 안전한 구현이지만 개선할 수 있습니다.현재 구현은 안전하지만, Kotlin의 inline reified를 사용하면 더 간결하고 타입 안전한 코드를 작성할 수 있습니다.
inline fun <reified T : ASTNode> findByType(root: ASTNode): List<T> { val result = mutableListOf<T>() if (root is T) { result.add(root) } for (child in root.getChildren()) { result.addAll(findByType<T>(child)) } return result }이렇게 하면 호출 시 클래스 파라미터를 전달할 필요가 없습니다:
// 기존: findByType(root, NumberNode::class.java) // 개선: findByType<NumberNode>(root)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/UnaryOpNode.kt (2)
153-167: 중복된 로직 리팩토링 제안
simplifyDoubleNegation()과simplifyDoubleLogicalNegation()메서드가 거의 동일한 로직을 가지고 있습니다. 제네릭 메서드로 통합하여 코드 중복을 줄일 수 있습니다.- fun simplifyDoubleNegation(): ASTNode { - check(canSimplifyDoubleNegation()) { "이중 음수를 단순화할 수 없습니다" } - return (operand as UnaryOpNode).operand - } - - fun simplifyDoubleLogicalNegation(): ASTNode { - check(canSimplifyDoubleNegation_Logical()) { "이중 논리 부정을 단순화할 수 없습니다" } - return (operand as UnaryOpNode).operand - } + private fun simplifyDoubleOperation(canSimplify: Boolean, errorMessage: String): ASTNode { + check(canSimplify) { errorMessage } + return (operand as UnaryOpNode).operand + } + + fun simplifyDoubleNegation(): ASTNode = + simplifyDoubleOperation(canSimplifyDoubleNegation(), "이중 음수를 단순화할 수 없습니다") + + fun simplifyDoubleLogicalNegation(): ASTNode = + simplifyDoubleOperation(canSimplifyDoubleLogicalNegation(), "이중 논리 부정을 단순화할 수 없습니다")
189-190: 복잡한 조건문 가독성 개선
toStringWithParentheses()메서드의 조건문이 복잡하여 가독성이 떨어집니다. 별도의 헬퍼 메서드로 분리하는 것을 권장합니다.+ private fun needsParentheses(operand: ASTNode): Boolean { + return when (operand) { + is BinaryOpNode -> true + is UnaryOpNode -> operand.getPrecedence() <= getPrecedence() + else -> false + } + } + fun toStringWithParentheses(): String { - val operandStr = when { - operand is BinaryOpNode -> "(${operand.toSimpleString()})" - operand is UnaryOpNode && operand.getPrecedence() <= getPrecedence() -> "(${operand.toSimpleString()})" - else -> operand.toSimpleString() - } + val operandStr = if (needsParentheses(operand)) { + "(${operand.toSimpleString()})" + } else { + operand.toSimpleString() + } return "$operator$operandStr" }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/aggregates/ExpressionEvaluator.kt (2)
3-3: 사용하지 않는 주석 제거주석 처리된 import 문을 제거하거나 필요하다면 주석을 해제해주세요.
-// import hs.kr.entrydsm.domain.evaluator.exceptions.EvaluatorException
501-503: 재귀 최적화 필요
gcd함수는 꼬리 재귀 최적화를 사용하면 스택 오버플로우를 방지할 수 있습니다.- private fun gcd(a: Long, b: Long): Long { + private tailrec fun gcd(a: Long, b: Long): Long { return if (b == 0L) a else gcd(b, a % b) }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/TypeCompatibilitySpec.kt (1)
145-159: 복잡한 when 표현식 단순화
areOperandsCompatible메서드의 when 표현식이 복잡합니다. 더 읽기 쉽게 리팩토링할 수 있습니다.fun areOperandsCompatible(operator: String, leftType: KClass<*>, rightType: KClass<*>): Boolean { val requirement = OPERATOR_TYPE_REQUIREMENTS[operator] ?: return false - return when (requirement) { - TypeRequirement.NUMERIC -> { - isNumericType(leftType) && isNumericType(rightType) - } - TypeRequirement.BOOLEAN_CONVERTIBLE -> { - isBooleanConvertible(leftType) && isBooleanConvertible(rightType) - } - TypeRequirement.STRING -> { - leftType == String::class && rightType == String::class - } - TypeRequirement.ANY -> true - TypeRequirement.SAME -> leftType == rightType - } + return satisfiesRequirement(leftType, requirement) && + satisfiesRequirement(rightType, requirement) && + (requirement != TypeRequirement.SAME || leftType == rightType) }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeSize.kt (2)
32-33: decrement 메서드의 일관성 확인 필요
decrement()메서드가 0 이하에서는 현재 값을 유지하는 반면,minus()메서드는maxOf(0, value - amount)를 사용합니다. 동작의 일관성을 검토해주세요.두 메서드 모두 0 이하로 내려가지 않도록 보장하므로 일관성이 있지만, 문서화를 통해 이 동작을 명확히 하는 것이 좋습니다.
159-161: 메모리 사용량 추정의 정확성노드당 64바이트는 추정치일 뿐입니다. 실제 메모리 사용량은 JVM 구현과 노드 타입에 따라 다를 수 있습니다.
/** * 메모리 사용량을 추정합니다 (바이트 단위). + * + * @return 추정 메모리 사용량 (실제 사용량과 다를 수 있음) */ fun estimateMemoryUsage(): Long { return value * BYTES_PER_NODE }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/VariableBinding.kt (2)
11-14: 문서의 날짜를 수정해주세요.문서에 미래 날짜(2025년)가 포함되어 있습니다. 현재 날짜로 수정이 필요합니다.
86-96: 타입 변경 허용에 대한 검토 필요
withValue메서드가 값 업데이트 시 타입 변경을 허용합니다. 이는 타입 안정성을 해칠 수 있으므로, 기존 타입과 일치하는지 검증하는 로직 추가를 고려해보세요.fun withValue(newValue: Any?): VariableBinding { require(!isReadonly) { "읽기 전용 변수는 수정할 수 없습니다: $name" } val newType = determineType(newValue) + if (type != VariableType.NULL && newType != type) { + require(newType == type) { "변수 '$name'의 타입을 변경할 수 없습니다: $type -> $newType" } + } return VariableBinding( name = name, value = newValue, type = newType, isReadonly = isReadonly, createdAt = createdAt ) }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/interfaces/CalculatorContract.kt (1)
15-18: 문서의 날짜를 수정해주세요.문서에 미래 날짜(2025년)가 포함되어 있습니다. 현재 날짜로 수정이 필요합니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/entities/MathFunction.kt (2)
20-23: 문서의 날짜를 수정해주세요.문서에 미래 날짜(2025년)가 포함되어 있습니다. 현재 날짜로 수정이 필요합니다.
97-104: 예외 처리 개선 필요함수 실행 중 발생한 예외를
RuntimeException으로 래핑할 때 더 많은 컨텍스트 정보를 포함하면 디버깅에 도움이 됩니다.fun execute(arguments: List<Any>): Any { validateArgumentCount(arguments) return try { implementation(arguments) } catch (e: Exception) { - throw RuntimeException("함수 '$name' 실행 중 오류 발생: ${e.message}", e) + throw RuntimeException( + "함수 '$name' 실행 중 오류 발생: ${e.message}\n" + + "인수: $arguments\n" + + "카테고리: ${category.displayName}", + e + ) } }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factories/ASTNodeFactory.kt (1)
17-20: 문서의 날짜를 수정해주세요.문서에 미래 날짜(2025년)가 포함되어 있습니다. 현재 날짜로 수정이 필요합니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/ArgumentsNode.kt (2)
15-18: 문서의 날짜를 수정해주세요.문서에 미래 날짜(2025년)가 포함되어 있습니다. 현재 날짜로 수정이 필요합니다.
3-3: 불필요한 import 제거
VariableNode는 같은 패키지에 있으므로 import가 필요하지 않습니다.-import hs.kr.entrydsm.domain.ast.entities.VariableNodecasper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationRequest.kt (1)
299-303: empty() 메서드의 의미가 불명확합니다"빈 요청"이라고 하면서 실제로는 "0"이라는 수식을 가진 요청을 생성합니다. 이는 혼란을 줄 수 있습니다.
다음 중 하나를 선택하세요:
- 메서드 이름을
default()또는zero()로 변경- 진짜 빈 요청이 필요하다면 nullable formula를 지원하도록 수정
- 최소한 주석을 더 명확하게 작성
/** * 기본값 0을 가진 요청을 생성합니다 (테스트용). */ fun default(): CalculationRequest = CalculationRequest("0")casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationStep.kt (1)
143-146: 연산자 카운팅 개선 가능현재 구현은
CalculationRequest보다 낫지만, 여전히 겹치는 연산자를 잘못 카운트할 수 있습니다. 예: "<<="는 "<"와 "<=" 모두로 카운트됩니다.더 정확한 카운팅을 위해 정규식이나 토큰화를 사용하세요:
// 긴 연산자부터 먼저 처리 val sortedOperators = operators.sortedByDescending { it.length } var tempFormula = formula sortedOperators.forEach { op -> val count = tempFormula.split(op).size - 1 complexity += count // 이미 카운트한 연산자는 제거 tempFormula = tempFormula.replace(op, " ") }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/aggregates/ExpressionAST.kt (2)
320-371: 서브트리 교체 로직이 올바르게 구현되었습니다.불변성을 유지하면서 트리를 재구성하는 방식이 적절합니다. 다만, 노드 타입별 재구성 로직을 별도 메서드로 추출하면 가독성이 향상될 것입니다.
435-457: 타임스탬프를 한 번만 캡처하세요.
LocalDateTime.now()를 여러 번 호출하면 미세하게 다른 시간이 기록될 수 있습니다.fun create(root: ASTNode): ExpressionAST { + val now = LocalDateTime.now() val ast = ExpressionAST( id = UUID.randomUUID().toString(), root = root, - createdAt = LocalDateTime.now(), - lastModifiedAt = LocalDateTime.now(), + createdAt = now, + lastModifiedAt = now, optimizationLevel = OptimizationLevel.NONE, isValidated = false, validationResult = null ) // 도메인 이벤트 발생 ast.addDomainEvent(mapOf( "eventType" to "AST_CREATED", "aggregateId" to ast.id, "aggregateType" to "ExpressionAST", "payload" to mapOf( "root" to root.toString(), - "createdAt" to LocalDateTime.now().toString() + "createdAt" to now.toString() ) ))casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/policies/NodeCreationPolicy.kt (1)
45-47: 빈 검증 메서드의 의도를 명확히 하세요.불리언 값이 항상 유효하다면, 이를 명시적으로 표현하거나 메서드를 제거하는 것이 좋습니다.
fun validateBooleanCreation(value: Boolean) { - // 불리언 값은 항상 유효 + // 불리언 값은 항상 유효하므로 추가 검증이 필요 없음 + // 이 메서드는 일관성을 위해 유지됨 }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/policies/CalculationPolicy.kt (1)
266-291: 복잡도 계산의 매직 넘버를 상수로 추출하세요.복잡도 계산에 사용되는 숫자들의 의미가 불명확합니다. 상수로 추출하여 의미를 명확히 하세요.
+ companion object { + // 기존 상수들... + + // 복잡도 가중치 + private const val OPERATOR_COMPLEXITY_WEIGHT = 2 + private const val NESTING_COMPLEXITY_WEIGHT = 10 + private const val FUNCTION_COMPLEXITY_WEIGHT = 20 + } + private fun calculateComplexity(expression: String): Int { var complexity = expression.length // 기본 복잡도 // 연산자 개수에 따른 복잡도 - complexity += expression.count { it in "+-*/%^" } * 2 + complexity += expression.count { it in "+-*/%^" } * OPERATOR_COMPLEXITY_WEIGHT // 괄호 깊이에 따른 복잡도 var depth = 0 var maxDepth = 0 for (char in expression) { when (char) { '(' -> { depth++ maxDepth = maxOf(maxDepth, depth) } ')' -> depth-- } } - complexity += maxDepth * 10 + complexity += maxDepth * NESTING_COMPLEXITY_WEIGHT // 함수 호출에 따른 복잡도 val functionCount = Regex("[a-zA-Z]\\w*\\(").findAll(expression).count() - complexity += functionCount * 20 + complexity += functionCount * FUNCTION_COMPLEXITY_WEIGHT return complexity }casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/MultiStepCalculationRequest.kt (1)
169-186: 복잡도 추정 로직 개선 제안현재 복잡도 추정 방식은 문자열 기반으로 되어 있어 다음과 같은 한계가 있습니다:
- 문자열 리터럴 내의 연산자도 카운트될 수 있음
- 함수 감지 정규식이 너무 단순함
- 매직 넘버들의 근거가 불명확함
AST 기반 분석이나 더 정교한 파싱을 사용하는 것을 고려해보세요.
더 정교한 복잡도 추정 로직을 구현하는데 도움이 필요하신가요?
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/EvaluatorFactory.kt (1)
39-39: null 처리 패턴 개선 가능
filterValues { it != null }.mapValues { it.value!! }패턴이 여러 곳에서 반복됩니다. Kotlin의 타입 시스템을 더 잘 활용할 수 있습니다.더 관용적인 Kotlin 코드로 개선:
-variables = variables.filterValues { it != null }.mapValues { it.value!! } +variables = variables.mapNotNull { (k, v) -> v?.let { k to it } }.toMap()또는 확장 함수를 만들어 재사용:
fun <K, V> Map<K, V?>.filterNotNullValues(): Map<K, V> = this.mapNotNull { (k, v) -> v?.let { k to it } }.toMap()Also applies to: 49-49, 174-174, 191-191
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (80)
.github/hooks/pre-commit(0 hunks).github/hooks/pre-push(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/aggregates/ExpressionAST.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/ASTNode.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/ArgumentsNode.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/BinaryOpNode.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/BooleanNode.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/FunctionCallNode.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/IfNode.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/NumberNode.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/UnaryOpNode.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/VariableNode.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/exceptions/ASTException.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factories/ASTNodeFactory.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/ASTBuilderContract.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/ASTBuilders.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/ArgsMultipleBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/ArgsSingleBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/BinaryOpBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/BooleanFalseBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/BooleanTrueBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/FunctionCallBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/FunctionCallEmptyBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/IdentityBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/IfBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/NumberBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/ParenthesizedBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/StartBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/UnaryOpBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/VariableBuilder.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/interfaces/ASTVisitor.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/policies/ASTValidationPolicy.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/policies/NodeCreationPolicy.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/services/TreeOptimizer.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/services/TreeTraverser.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/specifications/ASTValiditySpec.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/specifications/NodeStructureSpec.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/ASTOptimizationResult.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/ASTValidationResult.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeSize.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeType.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/OptimizationLevel.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/TreeDepth.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/TreeStatistics.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/aggregates/Calculator.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/entities/CalculationSession.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/exceptions/CalculatorException.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/factories/CalculatorFactory.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/interfaces/CalculatorContract.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/policies/CalculationPerformancePolicy.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/policies/CalculationPolicy.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/services/CalculatorService.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/services/ValidationService.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/specifications/CalculationValiditySpec.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationRequest.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationResult.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationStep.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/MultiStepCalculationRequest.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/PerformanceRecommendation.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/RecommendationPriority.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/RecommendationType.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/aggregates/ExpressionEvaluator.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/entities/EvaluationContext.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/entities/MathFunction.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/exceptions/EvaluatorException.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/EvaluatorFactory.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/MathFunctionFactory.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/interfaces/ASTVisitorContract.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/interfaces/EvaluatorContract.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/poc-code.md(24 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/EvaluationPolicy.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/TypeCoercionPolicy.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/services/MathFunctionService.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/CalculatorValiditySpec.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/ExpressionValiditySpec.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/TypeCompatibilitySpec.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/EvaluationResult.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/VariableBinding.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/VariableInfo.kt(1 hunks)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/VariableType.kt(1 hunks)
💤 Files with no reviewable changes (1)
- .github/hooks/pre-commit
🧰 Additional context used
🧬 Code Graph Analysis (13)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/CalculatorValiditySpec.kt (6)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/specifications/CalculationValiditySpec.kt (2)
validateVariables(185-207)validateSecurity(134-151)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/expresser/specifications/FormattingQualitySpec.kt (1)
hasBalancedParentheses(350-362)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/lexer/specifications/TokenValidationSpec.kt (2)
hasBalancedParentheses(309-324)isReservedWord(242-253)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/policies/ASTValidationPolicy.kt (2)
isValidVariableName(336-340)isReservedWord(354-356)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationStep.kt (1)
isValidVariableName(216-222)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/MultiStepCalculationRequest.kt (1)
extractVariablesFromFormula(209-232)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/ArgumentsNode.kt (1)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/IfNode.kt (2)
getVariables(32-33)getNodeCount(41-41)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/MathFunctionFactory.kt (1)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/NumberNode.kt (1)
abs(104-104)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/policies/ASTValidationPolicy.kt (1)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/policies/NodeCreationPolicy.kt (6)
isValidVariableName(260-264)isReservedWord(278-280)isSupportedBinaryOperator(293-295)isZeroConstant(307-309)isSupportedUnaryOperator(300-302)isValidFunctionName(269-273)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/services/MathFunctionService.kt (1)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/NumberNode.kt (1)
abs(104-104)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/TreeDepth.kt (1)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeSize.kt (3)
of(194-200)maxOf(240-242)isValidRange(272-274)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/EvaluatorFactory.kt (1)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/factories/CalculatorFactory.kt (2)
createDefaultEnvironment(308-317)getInstance(39-43)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/ExpressionValiditySpec.kt (2)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/CalculatorValiditySpec.kt (2)
validateSyntax(138-147)validateSecurity(128-133)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/EvaluationPolicy.kt (4)
validateSecurity(86-90)validateDepth(184-191)validateComplexity(227-230)containsSuspiciousPatterns(235-241)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/TypeCompatibilitySpec.kt (1)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/TypeCoercionPolicy.kt (1)
isNumericType(253-255)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/specifications/CalculationValiditySpec.kt (5)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/EvaluationPolicy.kt (6)
validateSecurity(86-90)validateComplexity(227-230)validateVariables(219-222)validateFunctions(203-206)validateOperators(211-214)extractFunctions(274-284)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/ExpressionValiditySpec.kt (3)
validateSecurity(139-143)validateComplexity(251-254)validateSemantics(115-119)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/policies/ASTValidationPolicy.kt (1)
calculateNestingDepth(382-391)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/interfaces/CalculatorContract.kt (2)
extractVariables(87-87)extractFunctions(95-95)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationStep.kt (1)
extractVariables(103-129)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationRequest.kt (3)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationResult.kt (1)
estimateComplexity(148-173)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/MultiStepCalculationRequest.kt (4)
estimateComplexity(146-161)findMissingVariables(239-248)findUnusedVariables(255-258)isValid(309-319)casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/CalculationStep.kt (2)
estimateComplexity(136-170)isValid(198-208)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/factories/CalculatorFactory.kt (1)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/EvaluatorFactory.kt (3)
getInstance(259-260)createDefaultEnvironment(138-148)createScientificEnvironment(198-213)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeSize.kt (1)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/TreeDepth.kt (3)
of(150-156)maxOf(181-183)isValidRange(204-206)
🪛 markdownlint-cli2 (0.17.2)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/poc-code.md
2494-2494: Code block style
Expected: indented; Actual: fenced
(MD046, code-block-style)
🪛 detekt (1.23.8)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/EvaluationPolicy.kt
[warning] 75-75: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/VariableNode.kt
[warning] 184-184: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/services/CalculatorService.kt
[warning] 462-462: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/aggregates/Calculator.kt
[warning] 187-187: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
[warning] 202-202: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/policies/CalculationPolicy.kt
[warning] 73-73: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/TypeCoercionPolicy.kt
[warning] 171-171: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/ExpressionValiditySpec.kt
[warning] 65-65: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
[warning] 81-81: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/MultiStepCalculationRequest.kt
[warning] 316-316: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/TypeCompatibilitySpec.kt
[warning] 116-116: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
[warning] 130-130: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/specifications/CalculationValiditySpec.kt
[warning] 176-176: The caught exception is swallowed. The original exception could be lost.
(detekt.exceptions.SwallowedException)
🔇 Additional comments (45)
.github/hooks/pre-push (1)
6-9: 빌드 검증 로직이 올바르게 구현됨Gradle 빌드 실패 시 푸시를 중단하는 로직이 정확합니다.
--no-daemon옵션 사용으로 CI 환경에서의 안정성도 고려되었습니다.casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/entities/EvaluationContext.kt (1)
28-282: 불변성 패턴이 잘 구현되었습니다
EvaluationContext가 불변 엔티티 패턴을 따르며, 모든 수정 작업이 새로운 인스턴스를 반환하도록 구현되어 있습니다. 검증 로직도 적절히 포함되어 있고, 팩토리 메서드들이 깔끔하게 정의되어 있습니다. DDD 원칙을 잘 따르고 있습니다.casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/exceptions/EvaluatorException.kt (1)
23-23: 문서의 날짜가 올바르지 않습니다.
@since태그의 날짜가 "2025.07.15"로 되어 있는데, 이는 미래 날짜입니다. 올바른 날짜로 수정해주세요.- * @since 2025.07.15 + * @since 2024.07.15Likely an incorrect or invalid review comment.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/VariableType.kt (1)
1-11: 좋은 구현입니다!
VariableType열거형이 깔끔하게 구현되었으며, 변수 타입 분류에 적합한 값들을 포함하고 있습니다.casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/RecommendationPriority.kt (1)
7-7: 문서의 날짜가 올바르지 않습니다.
@since태그의 날짜가 "2025.07.28"로 되어 있는데, 이는 미래 날짜입니다. 올바른 날짜로 수정해주세요.- * @since 2025.07.28 + * @since 2024.07.28Likely an incorrect or invalid review comment.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/OptimizationLevel.kt (1)
1-10: 훌륭한 구현입니다!
OptimizationLevel열거형이 명확한 한국어 설명과 함께 잘 구성되어 있습니다. 최적화 수준을 표현하는데 적합한 구조입니다.casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/PerformanceRecommendation.kt (1)
1-17: 깔끔한 값 객체 구현입니다.성능 권장사항을 나타내는 데이터 클래스가 잘 설계되었습니다. 불변 설계, 명확한 프로퍼티 이름, 그리고 적절한 KDoc 문서화가 도메인 모델링 관례를 잘 따르고 있습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/ASTValidationResult.kt (1)
1-13: 검증 결과를 잘 캡슐화한 데이터 클래스입니다.AST 검증 결과를 담는 값 객체가 적절하게 설계되었습니다. 필요한 정보를 모두 포함하고 있으며 불변 설계를 따르고 있습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/VariableInfo.kt (1)
1-14: 변수 메타데이터를 잘 표현한 값 객체입니다.변수 정보를 담는 데이터 클래스가 일관성 있게 설계되었습니다. 필요한 메타데이터를 적절히 캡슐화하고 있으며 다른 도메인 값 객체들과 일관된 패턴을 따르고 있습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/poc-code.md (1)
1-2494: 문서 형식 개선이 잘 되었습니다.POC 코드 문서의 형식과 공백 정리가 적절히 수행되었습니다. 주석 명확화와 일관된 형식으로 가독성이 향상되었으며, 기능적 변경 없이 문서 품질이 개선되었습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/BooleanTrueBuilder.kt (1)
1-34: 일관성 있는 빌더 패턴 구현입니다.BooleanTrueBuilder 객체가 팩토리 패턴을 잘 따라 구현되었습니다. 적절한 어노테이션 사용, 자식 노드 검증, 싱글톤 BooleanNode.TRUE 반환 등이 다른 빌더들과 일관성 있게 작성되었습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/ASTOptimizationResult.kt (2)
17-23: 최적화 비율 계산 로직이 올바르게 구현되었습니다.
getReductionRatio()메서드가 영으로 나누기 예외를 적절히 처리하고 있으며, 최적화 전후의 크기 차이를 정확히 계산합니다.
8-16: 도메인 값 객체의 적절한 활용
NodeSize,TreeDepth,OptimizationLevel등의 도메인 값 객체를 사용하여 타입 안전성을 확보하고 도메인 개념을 명확히 표현했습니다.casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/TreeStatistics.kt (1)
8-17: 트리 통계 데이터 클래스가 잘 설계되었습니다.포괄적인 AST 통계 정보를 담고 있으며, 도메인 값 객체를 적절히 활용하여 타입 안전성을 확보했습니다. 불변 값 객체로서 적절한 구조를 가지고 있습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/ArgsSingleBuilder.kt (2)
27-30: 단일 인수 변환 로직이 올바르게 구현되었습니다.하나의
ASTNode를 인수 목록으로 적절히 변환하고 있으며, 타입 캐스팅도 안전하게 수행됩니다.
32-34: 적절한 유효성 검증자식 요소의 개수와 타입을 모두 검증하여 안전한 빌드 과정을 보장합니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/IfBuilder.kt (1)
38-43: 유효성 검증이 빌드 로직과 일치합니다.검증 메서드가 빌드 메서드에서 사용하는 인덱스와 타입 요구사항을 정확히 반영하고 있습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/interfaces/ASTVisitor.kt (1)
1-88: 뛰어난 Visitor 패턴 구현입니다!이
ASTVisitor<T>인터페이스는 다음과 같은 장점을 가지고 있습니다:
- 제네릭 타입 파라미터를 통한 유연한 반환 타입 지원
- 모든 AST 노드 타입에 대한 완전한 방문 메서드 제공
- 일관된 메서드 시그니처와 명명 규칙
- 포괄적인 한국어 문서화
AST 처리 로직을 노드 클래스와 분리하는 깔끔한 설계입니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/NumberBuilder.kt (1)
27-43: 안전하고 견고한 숫자 파싱 구현입니다!다음과 같은 우수한 구현 특징들이 있습니다:
toDoubleOrNull()을 사용한 안전한 타입 변환- 명확하고 도움이 되는 에러 메시지
- 일관된 검증 로직 (
build와validateChildren모두에서)- 적절한 예외 처리
숫자 리터럴 처리가 안전하고 예측 가능하게 구현되었습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/UnaryOpBuilder.kt (1)
27-47: 유연하고 잘 설계된 단항 연산자 빌더입니다!다음과 같은 우수한 설계 특징들이 있습니다:
- 설정 가능한
operandIndex로 다양한 문법 위치 지원- 경계 검사와 타입 안전성을 모두 고려한 검증 로직
- 구체적이고 도움이 되는 에러 메시지
- 생성자 매개변수를 통한 재사용 가능한 설계
문법의 다양한 단항 연산자 패턴을 효과적으로 처리할 수 있는 설계입니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/factory/builders/BinaryOpBuilder.kt (1)
39-39: 재귀 호출 문제가 있습니다
copy()메서드가 자기 자신을 재귀적으로 호출하여 무한 재귀로 인한 스택 오버플로우가 발생합니다.다음과 같이 수정하세요:
- override fun copy(): VariableNode = this.copy() + override fun copy(): VariableNode = VariableNode(name)Likely an incorrect or invalid review comment.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/interfaces/EvaluatorContract.kt (1)
1-144: 잘 설계된 인터페이스입니다평가자 계약 인터페이스가 명확하고 포괄적으로 정의되어 있습니다. Anti-Corruption Layer 패턴을 적절히 적용하여 구현체와 클라이언트 간의 결합도를 낮추었습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeType.kt (1)
1-167: 잘 구성된 노드 타입 정의AST 노드 타입을 명확하게 분류하고 유용한 유틸리티 메서드들을 제공합니다. 도메인 모델에 적합한 값 객체로 잘 설계되었습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/TypeCoercionPolicy.kt (1)
169-174: 예외 처리가 의도적으로 설계되었습니다정적 분석 도구가 예외를 삼키는 것에 대해 경고했지만, 이는 타입 호환성을 확인하는 의도적인 설계입니다. 필요하다면 로깅을 추가할 수 있습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/TreeDepth.kt (3)
14-19: 구현이 적절합니다!값 객체의 private 생성자와 유효성 검증이 DDD 패턴에 잘 부합합니다.
12-12: @SInCE 날짜 확인 필요
@since 2025.07.16날짜가 미래 시점으로 보입니다. 올바른 날짜인지 확인이 필요합니다.
111-119: getLevel() 메서드의 로직 오류현재 구현은 잘못된 조건 순서로 인해 레벨을 올바르게 판단하지 못합니다. 예를 들어, 깊이가 85인 경우 CRITICAL이 아닌 DEEP으로 분류됩니다.
fun getLevel(): DepthLevel { return when { - value <= SHALLOW_DEPTH -> DepthLevel.SHALLOW - value <= NORMAL_DEPTH -> DepthLevel.NORMAL - value <= DEEP_DEPTH -> DepthLevel.DEEP - value <= WARNING_DEPTH -> DepthLevel.WARNING - else -> DepthLevel.CRITICAL + value > WARNING_DEPTH -> DepthLevel.CRITICAL + value > DEEP_DEPTH -> DepthLevel.WARNING + value > NORMAL_DEPTH -> DepthLevel.DEEP + value > SHALLOW_DEPTH -> DepthLevel.NORMAL + else -> DepthLevel.SHALLOW } }Likely an incorrect or invalid review comment.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/exceptions/ASTException.kt (1)
43-63: 메시지 구성 로직이 깔끔합니다!null 안전 연산자와 함수형 프로그래밍 스타일을 잘 활용하여 가독성 높은 코드를 작성했습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/MathFunctionFactory.kt (1)
286-296: 수학 함수의 정의역 검증이 적절합니다!역삼각함수들의 정의역을 올바르게 검증하고 있으며, 명확한 한국어 오류 메시지를 제공합니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/NumberNode.kt (1)
164-178: 상수 정의가 잘 되어 있습니다자주 사용되는 값들을 상수로 정의하여 메모리 효율성과 성능을 개선했습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/BooleanNode.kt (1)
131-149: 싱글톤 패턴의 훌륭한 활용입니다!불변 객체인
BooleanNode에 대해 TRUE와 FALSE 싱글톤 인스턴스를 제공하는 것은 메모리 효율성과 성능 측면에서 좋은 설계입니다.casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/aggregates/ExpressionEvaluator.kt (1)
32-32: 누락된 import 추가 필요Line 531에서
minOf함수를 사용하지만 import가 누락되어 있습니다.+import kotlin.comparisons.minOf import kotlin.math.powLikely an incorrect or invalid review comment.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeSize.kt (2)
1-290: 잘 설계된 값 객체전반적으로 잘 설계된 값 객체입니다:
- 불변성 보장
- 적절한 검증
- 풍부한 도메인 메서드
- 명확한 팩토리 메서드
254-258: 합계 계산 시 오버플로우 가능성
sum메서드에서 여러 NodeSize의 합이 MAX_SIZE를 초과할 수 있습니다.fun sum(sizes: List<NodeSize>): NodeSize { if (sizes.isEmpty()) return ZERO val total = sizes.sumOf { it.value } + if (total > MAX_SIZE) { + throw IllegalArgumentException("합계가 최대 크기를 초과합니다: $total > $MAX_SIZE") + } return of(total) }Likely an incorrect or invalid review comment.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/VariableBinding.kt (2)
46-53: 불리언 변환 로직 재검토 필요숫자를 불리언으로 변환하는 로직(0이 아닌 값을 true로 변환)이 도메인 요구사항에 맞는지 확인이 필요합니다. 일반적으로 타입 불일치 시 예외를 발생시키는 것이 더 안전할 수 있습니다.
198-202: 유틸리티 메서드 구현이 적절합니다.변수명 검증 로직과 수학 상수 정의가 잘 구현되어 있습니다.
Also applies to: 232-240
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/ArgumentsNode.kt (2)
322-349: 통계 계산 메서드가 잘 구현되었습니다.빈 리스트에 대한 처리와 다양한 통계 정보 계산이 적절히 구현되어 있습니다.
25-27: 인수 개수 제한이 적절합니다.
MAX_ARGUMENTS를 100으로 제한한 것은 메모리 문제를 방지하는 좋은 접근입니다.Also applies to: 283-283
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/IfNode.kt (1)
295-315: flatten 메서드의 논리 오류 가능성중첩된 IF를 평면화할 때 false 분기 처리에 문제가 있을 수 있습니다. 현재 구현은 false 분기로 들어갈 때 이전의 모든 조건을 유지하면서 현재 조건만 부정하는데, 이는 올바른 논리 경로를 표현하지 못할 수 있습니다.
다음 예시를 고려해보세요:
IF(A, IF(B, 1, 2), 3)현재 구현은 다음과 같이 평면화됩니다:
- A && B → 1
- A && !B → 2
- !A → 3
이것이 의도한 동작인지 확인이 필요합니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/FunctionCallNode.kt (1)
253-276: 함수 목록 관리의 좋은 예시이 클래스는 함수 목록을 체계적으로 관리하는 좋은 예시입니다.
CalculationRequest와CalculationStep에서도 이와 같은 접근 방식을 사용하면 좋겠습니다.casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/policies/CalculationPolicy.kt (1)
337-341: 0으로 나누기 방지가 올바르게 구현되었습니다.평균 계산 시 0으로 나누기를 방지하는 로직이 적절히 구현되어 있습니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/specifications/CalculationValiditySpec.kt (1)
376-388: 변수 추출 로직이 올바르게 구현되었습니다.함수명을 제외하고 변수만 추출하는 로직이 적절합니다.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/entities/CalculationSession.kt (2)
244-248: 세션 활성 상태 확인 로직이 적절합니다.
InstantAPI를 사용한 시간 계산이 올바르게 구현되었습니다.
302-313: 세션 요약 메서드가 잘 구현되었습니다.
buildString을 사용한 효율적인 문자열 생성과 적절한 포맷팅이 적용되었습니다.casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/MultiStepCalculationRequest.kt (1)
18-18: 날짜가 미래로 설정되어 있습니다
@since태그의 날짜가 2025.07.21로 되어 있는데, 현재가 2025년 8월이라면 이는 미래 날짜입니다. 2024.07.21 또는 다른 과거 날짜로 수정이 필요합니다.- * @since 2025.07.21 + * @since 2024.07.21Likely an incorrect or invalid review comment.
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/ASTNode.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/BinaryOpNode.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/NumberNode.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/VariableNode.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/VariableNode.kt
Outdated
Show resolved
Hide resolved
...lication-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/EvaluationPolicy.kt
Show resolved
Hide resolved
...cation-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/policies/TypeCoercionPolicy.kt
Show resolved
Hide resolved
...ation-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/services/MathFunctionService.kt
Show resolved
Hide resolved
...ain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/CalculatorValiditySpec.kt
Show resolved
Hide resolved
...pplication-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/values/EvaluationResult.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/aggregates/ExpressionAST.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/aggregates/ExpressionAST.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/BooleanNode.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/IfNode.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/UnaryOpNode.kt
Show resolved
Hide resolved
...ain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/ExpressionValiditySpec.kt
Show resolved
Hide resolved
...ain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/ExpressionValiditySpec.kt
Show resolved
Hide resolved
...main/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/TypeCompatibilitySpec.kt
Show resolved
Hide resolved
...main/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/TypeCompatibilitySpec.kt
Outdated
Show resolved
Hide resolved
...main/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/specifications/TypeCompatibilitySpec.kt
Show resolved
Hide resolved
...ation-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/entities/CalculationSession.kt
Show resolved
Hide resolved
...ation-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/factories/CalculatorFactory.kt
Show resolved
Hide resolved
...ation-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/factories/CalculatorFactory.kt
Outdated
Show resolved
Hide resolved
...ation-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/factories/CalculatorFactory.kt
Outdated
Show resolved
Hide resolved
...ation-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/factories/CalculatorFactory.kt
Outdated
Show resolved
Hide resolved
...omain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/MultiStepCalculationRequest.kt
Show resolved
Hide resolved
...omain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/values/MultiStepCalculationRequest.kt
Show resolved
Hide resolved
...ication-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/EvaluatorFactory.kt
Show resolved
Hide resolved
...ication-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/EvaluatorFactory.kt
Show resolved
Hide resolved
...ication-domain/src/main/kotlin/hs/kr/entrydsm/domain/evaluator/factories/EvaluatorFactory.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/services/TreeOptimizer.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/services/TreeOptimizer.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/services/TreeOptimizer.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/services/TreeTraverser.kt
Outdated
Show resolved
Hide resolved
...cation-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/services/CalculatorService.kt
Show resolved
Hide resolved
...cation-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/services/CalculatorService.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/services/TreeOptimizer.kt
Show resolved
Hide resolved
...cation-domain/src/main/kotlin/hs/kr/entrydsm/domain/calculator/services/CalculatorService.kt
Outdated
Show resolved
Hide resolved
...lication-domain/src/main/kotlin/hs/kr/entrydsm/domain/expresser/services/ExpresserService.kt
Show resolved
Hide resolved
...lication-domain/src/main/kotlin/hs/kr/entrydsm/domain/expresser/services/ExpresserService.kt
Show resolved
Hide resolved
...lication-domain/src/main/kotlin/hs/kr/entrydsm/domain/expresser/services/ExpresserService.kt
Show resolved
Hide resolved
...ication-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/LRParserTableService.kt
Show resolved
Hide resolved
...er-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/ParserService.kt
Outdated
Show resolved
Hide resolved
...lication-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/RealLRParserService.kt
Outdated
Show resolved
Hide resolved
...application-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/ConflictResolver.kt
Outdated
Show resolved
Hide resolved
...application-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/ConflictResolver.kt
Show resolved
Hide resolved
...tion-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/ConflictResolverService.kt
Outdated
Show resolved
Hide resolved
...tion-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/ConflictResolverService.kt
Outdated
Show resolved
Hide resolved
...cation-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/OptimizedParsingTable.kt
Outdated
Show resolved
Hide resolved
...cation-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/OptimizedParsingTable.kt
Outdated
Show resolved
Hide resolved
...pplication-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/services/StateCacheManager.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/entities/ArgumentsNode.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeSize.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeType.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeType.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeType.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/values/NodeType.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/aggregates/ExpressionAST.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/aggregates/ExpressionAST.kt
Outdated
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/aggregates/ExpressionAST.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/aggregates/ExpressionAST.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/ast/aggregates/ExpressionAST.kt
Show resolved
Hide resolved
...ation-domain/src/main/kotlin/hs/kr/entrydsm/domain/lexer/specifications/InputValiditySpec.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/entities/LRItem.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/entities/ParsingState.kt
Show resolved
Hide resolved
casper-application-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/entities/Production.kt
Show resolved
Hide resolved
...plication-domain/src/main/kotlin/hs/kr/entrydsm/domain/parser/factories/ASTBuilderFactory.kt
Show resolved
Hide resolved
coehgns
left a comment
There was a problem hiding this comment.
제가 실수 한 부분이 있으면 그냥 넘어가주세요~
수식 QL 도메인을 구축하였습니다.
Summary by CodeRabbit
New Features
Chores