Skip to content

Commit

Permalink
refactor: update for hold
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 26, 2023
1 parent e1ea1dc commit 6c9bdc3
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,22 @@ import com.knuddels.jtokkit.api.EncodingType
import org.archguard.scanner.analyser.count.LanguageService
import org.slf4j.Logger

/**
* The `ThresholdChecker` class is responsible for determining whether a given job or instruction
* meets the threshold criteria for processing. It utilizes various criteria, including file type,
* code complexity, file size, and token length, to make these determinations.
*
* @property context The worker context providing configuration settings for the threshold checks.
*/
class ThresholdChecker(private val context: WorkerContext) {
private var registry: EncodingRegistry = Encodings.newDefaultEncodingRegistry()
private var enc: Encoding = registry.getEncoding(EncodingType.CL100K_BASE)

private val language: LanguageService = LanguageService()

private val supportedExtensions: Set<String> = setOf(
language.getExtension(SupportedLang.JAVA.name.lowercase()),
)
private val supportedExtensions: Set<String> = SupportedLang.all().map {
language.getExtension(it.name.lowercase())
}.toSet()

private val logger: Logger = org.slf4j.LoggerFactory.getLogger(ThresholdChecker::class.java)

Expand Down

0 comments on commit 6c9bdc3

Please sign in to comment.