{"$schema":"https://json.schemastore.org/sarif-2.1.0.json","version":"2.1.0","runs":[{"tool":{"driver":{"name":"codehealth","informationUri":"https://codehealth.canine.dev","rules":[{"id":"D1","name":"Cyclomatic Complexity","shortDescription":{"text":"Cyclomatic Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D1"},{"id":"D2","name":"Cognitive Complexity","shortDescription":{"text":"Cognitive Complexity"},"helpUri":"https://codehealth.canine.dev/dimensions/D2"},{"id":"D3","name":"God Classes","shortDescription":{"text":"God Classes"},"helpUri":"https://codehealth.canine.dev/dimensions/D3"},{"id":"D4","name":"Code Duplication","shortDescription":{"text":"Code Duplication"},"helpUri":"https://codehealth.canine.dev/dimensions/D4"},{"id":"D9","name":"Test Distribution","shortDescription":{"text":"Test Distribution"},"helpUri":"https://codehealth.canine.dev/dimensions/D9"},{"id":"D11","name":"Test Reliability","shortDescription":{"text":"Test Reliability"},"helpUri":"https://codehealth.canine.dev/dimensions/D11"},{"id":"D13","name":"Secret Scanning","shortDescription":{"text":"Secret Scanning"},"helpUri":"https://codehealth.canine.dev/dimensions/D13","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D14","name":"License Compliance","shortDescription":{"text":"License Compliance"},"helpUri":"https://codehealth.canine.dev/dimensions/D14"},{"id":"D15","name":"Churn \u00D7 Complexity Hotspots","shortDescription":{"text":"Churn \u00D7 Complexity Hotspots"},"helpUri":"https://codehealth.canine.dev/dimensions/D15"},{"id":"D16","name":"Bus Factor","shortDescription":{"text":"Bus Factor"},"helpUri":"https://codehealth.canine.dev/dimensions/D16"},{"id":"D17","name":"Explicit Debt","shortDescription":{"text":"Explicit Debt"},"helpUri":"https://codehealth.canine.dev/dimensions/D17"},{"id":"D19","name":"Documentation Quality","shortDescription":{"text":"Documentation Quality"},"helpUri":"https://codehealth.canine.dev/dimensions/D19"},{"id":"D21","name":"Naming Consistency","shortDescription":{"text":"Naming Consistency"},"helpUri":"https://codehealth.canine.dev/dimensions/D21"},{"id":"D28","name":"Secrets (history)","shortDescription":{"text":"Secrets (history)"},"helpUri":"https://codehealth.canine.dev/dimensions/D28","relationships":[{"target":{"id":"CWE-798","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-259","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-798","CWE-259"]}},{"id":"D29","name":"Static Analysis (SAST)","shortDescription":{"text":"Static Analysis (SAST)"},"helpUri":"https://codehealth.canine.dev/dimensions/D29","relationships":[{"target":{"id":"CWE-79","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-89","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-94","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-77","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-79","CWE-89","CWE-78","CWE-94","CWE-77"]}},{"id":"D31","name":"IaC \u0026 Container Security","shortDescription":{"text":"IaC \u0026 Container Security"},"helpUri":"https://codehealth.canine.dev/dimensions/D31","relationships":[{"target":{"id":"CWE-1032","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-732","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-16","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1032","CWE-732","CWE-16"]}},{"id":"D34","name":"Knowledge Freshness","shortDescription":{"text":"Knowledge Freshness"},"helpUri":"https://codehealth.canine.dev/dimensions/D34"},{"id":"D35","name":"Change Coupling","shortDescription":{"text":"Change Coupling"},"helpUri":"https://codehealth.canine.dev/dimensions/D35"},{"id":"D36","name":"Supply-chain Provenance \u0026 Signing","shortDescription":{"text":"Supply-chain Provenance \u0026 Signing"},"helpUri":"https://codehealth.canine.dev/dimensions/D36","relationships":[{"target":{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]},{"target":{"id":"CWE-494","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},"kinds":["relevant"]}],"properties":{"cwe":["CWE-1357","CWE-494"]}},{"id":"D44","name":"Platform End-of-Life","shortDescription":{"text":"Platform End-of-Life"},"helpUri":"https://codehealth.canine.dev/dimensions/D44"},{"id":"AX10","name":"Code composition","shortDescription":{"text":"Code composition"},"helpUri":"https://codehealth.canine.dev/dimensions/AX10"},{"id":"AXB2","name":"Runtime readiness","shortDescription":{"text":"Runtime readiness"},"helpUri":"https://codehealth.canine.dev/dimensions/AXB2"},{"id":"M1","name":"Documentation (README)","shortDescription":{"text":"Documentation (README)"},"helpUri":"https://codehealth.canine.dev/dimensions/M1"},{"id":"M2","name":"Architecture documentation","shortDescription":{"text":"Architecture documentation"},"helpUri":"https://codehealth.canine.dev/dimensions/M2"},{"id":"M3","name":"Folder \u0026 project structure","shortDescription":{"text":"Folder \u0026 project structure"},"helpUri":"https://codehealth.canine.dev/dimensions/M3"},{"id":"M4","name":"Documentation accuracy","shortDescription":{"text":"Documentation accuracy"},"helpUri":"https://codehealth.canine.dev/dimensions/M4"},{"id":"P1","name":"CI/CD gates","shortDescription":{"text":"CI/CD gates"},"helpUri":"https://codehealth.canine.dev/dimensions/P1"},{"id":"P12","name":"CI test-gate honesty","shortDescription":{"text":"CI test-gate honesty"},"helpUri":"https://codehealth.canine.dev/dimensions/P12"},{"id":"P3","name":"Security \u0026 performance tooling","shortDescription":{"text":"Security \u0026 performance tooling"},"helpUri":"https://codehealth.canine.dev/dimensions/P3"},{"id":"P4","name":"Deployment \u0026 Rollback","shortDescription":{"text":"Deployment \u0026 Rollback"},"helpUri":"https://codehealth.canine.dev/dimensions/P4"},{"id":"P6","name":"Release Hygiene","shortDescription":{"text":"Release Hygiene"},"helpUri":"https://codehealth.canine.dev/dimensions/P6"},{"id":"S1","name":"Web-Security Posture","shortDescription":{"text":"Web-Security Posture"},"helpUri":"https://codehealth.canine.dev/dimensions/S1"},{"id":"X9","name":"Subsumed condition operand","shortDescription":{"text":"Subsumed condition operand"},"helpUri":"https://codehealth.canine.dev/dimensions/X9"}]}},"results":[{"ruleId":"D1","level":"warning","message":{"text":"Conversation.get_prompt (cyclomatic 91): Conversation.get_prompt has cyclomatic complexity 91 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/conversation.py"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"9485e957800321412081b6b4da6c817d73ae9800a573f96e3702eb8beb8d2ef5"}},{"ruleId":"D1","level":"warning","message":{"text":"inference.generate_stream (cyclomatic 47): inference.generate_stream has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/inference.py"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"a9162f917ab19204609ec908d1b4909ae7c437895a8e835495b43612df617df1"}},{"ruleId":"D1","level":"warning","message":{"text":"train_yuan2.preprocess (cyclomatic 43): train_yuan2.preprocess has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_yuan2.py"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"66c0f0c462f0a0d26a92ff5b0419de633f5eee00d0a6ff391e74e2af9e14ca9c"}},{"ruleId":"D1","level":"warning","message":{"text":"clean_battle_data.process_data (cyclomatic 38): clean_battle_data.process_data has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/clean_battle_data.py"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"8c4fdecaefa0e14239583ea05c91beeeb5ef6f70b31de57433b2ce6c6ce23e73"}},{"ruleId":"D1","level":"warning","message":{"text":"model_adapter.load_model (cyclomatic 37): model_adapter.load_model has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_adapter.py"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba6db8bd3bcd29a543194be529bcdb3f25847bc9e82b6bca0b0516689ce18766"}},{"ruleId":"D1","level":"warning","message":{"text":"api_provider.get_api_provider_stream_iter (cyclomatic 31): api_provider.get_api_provider_stream_iter has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"7d20d7aa160cd882224e33f16e24048701803384260f1474868c511c92ca1736"}},{"ruleId":"D1","level":"warning","message":{"text":"inference.chat_loop (cyclomatic 31): inference.chat_loop has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/inference.py"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"75a583ea6a83dbe4cf9846b22ac42154135565cc576bb91fb6fdb7d0dc9512ca"}},{"ruleId":"D1","level":"warning","message":{"text":"train_lora.train (cyclomatic 26): train_lora.train has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora.py"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"b7e4eb5bb303a79ce8b67dfe0244e704a6fabf2b5b3fa46bd58be8faf0843348"}},{"ruleId":"D1","level":"warning","message":{"text":"api_provider.openai_assistant_api_stream_iter (cyclomatic 23): api_provider.openai_assistant_api_stream_iter has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":511}}}],"partialFingerprints":{"codehealthFindingId/v1":"12bb00a5622e9736293b1ee33cd80eaf8b3cc82097b288032e09c0e8d7037135"}},{"ruleId":"D1","level":"warning","message":{"text":"gen_model_answer.get_model_answers (cyclomatic 22): gen_model_answer.get_model_answers has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/gen_model_answer.py"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"fa1f3cb6036b1ced04d2f30b4f246135c75d81906d9bba5834ad5569204bcef7"}},{"ruleId":"D1","level":"warning","message":{"text":"DashInferWorker.generate_stream (cyclomatic 22): DashInferWorker.generate_stream has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/dashinfer_worker.py"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"8378020813391e81029779f7641d769bdf93c77d1f7373d8d14ba9413b4bc8de"}},{"ruleId":"D1","level":"warning","message":{"text":"LightLLMWorker.generate_stream (cyclomatic 22): LightLLMWorker.generate_stream has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/lightllm_worker.py"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"916c0a87a3f266412b9c75e9140dbdf23c8d80a9b8fe3ac502c624be4cb70c88"}},{"ruleId":"D1","level":"warning","message":{"text":"compression.load_compress_model (cyclomatic 20): compression.load_compress_model has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/compression.py"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf37271b340005fd604541e8e35e75c9b69655909d81a3e2ed142f61325e8242"}},{"ruleId":"D1","level":"warning","message":{"text":"VLLMWorker.generate_stream (cyclomatic 20): VLLMWorker.generate_stream has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/vllm_worker.py"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c1e4aa7ec173748264b62b6ba62638fd27d9cbf5de2c0365f63e63cb8b9c40f"}},{"ruleId":"D1","level":"warning","message":{"text":"gradio_block_arena_vision_named.add_text (cyclomatic 19): gradio_block_arena_vision_named.add_text has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision_named.py"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed8ea68cb09a7b2ab7f69faee97cc30dbfb962518826d2d38481997de2eb33fd"}},{"ruleId":"D1","level":"warning","message":{"text":"gradio_web_server.bot_response (cyclomatic 19): gradio_web_server.bot_response has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_web_server.py"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"8ed3acf68fc69a12e251b2cb1fcaf4866439e2a5a01c66d0c20f0cd4ef236a94"}},{"ruleId":"D1","level":"warning","message":{"text":"openai_api_server.check_requests (cyclomatic 19): openai_api_server.check_requests has cyclomatic complexity 19 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"415cb7d763defc4102352f71305050decb6b08fda7f1a73bb4ac4996c5a98b9a"}},{"ruleId":"D1","level":"warning","message":{"text":"train_lora_t5.train (cyclomatic 19): train_lora_t5.train has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora_t5.py"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d6dbb1937a74b6bad271ff8401eb387b6b696c7f24a0cc212ad46564000096c"}},{"ruleId":"D1","level":"warning","message":{"text":"model_falcon.generate_stream_falcon (cyclomatic 18): model_falcon.generate_stream_falcon has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_falcon.py"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"51091a792f89895c1d40225bc269b318293f021bd242dbe5c030cc4644775384"}},{"ruleId":"D1","level":"warning","message":{"text":"model_yuan2.generate_stream_yuan2 (cyclomatic 18): model_yuan2.generate_stream_yuan2 has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_yuan2.py"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"c1f1757e18ef77a0b0848397916e90320756d08affa25c7590de544424d7f46b"}},{"ruleId":"D1","level":"warning","message":{"text":"compute_agreement.get_mt_bench_agreement (cyclomatic 17): compute_agreement.get_mt_bench_agreement has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/compute_agreement.py"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"e049b50246008506e244d0f7ec6695d327d82278b953a78aa7af826c152beaaf"}},{"ruleId":"D1","level":"warning","message":{"text":"common.run_judge_pair (cyclomatic 16): common.run_judge_pair has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/common.py"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c9b6ab9394a0a99fef35b2e085a22daf94201fba592c5e657fca4aa65d7f7bc"}},{"ruleId":"D1","level":"warning","message":{"text":"topic_clustering.read_texts (cyclomatic 16): topic_clustering.read_texts has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/topic_clustering.py"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"608dc540eec6528eebc6afcc0fa340ce763d9ccd18a13df522c35f738ebb45e7"}},{"ruleId":"D1","level":"warning","message":{"text":"SGLWorker.generate_stream (cyclomatic 16): SGLWorker.generate_stream has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/sglang_worker.py"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f68bb28ecd990a80ca6e27b0439109b02855e896a4298b24f5e42997f9fc71d"}},{"ruleId":"D2","level":"warning","message":{"text":"Conversation.get_prompt (cognitive 204): Conversation.get_prompt has cognitive complexity 204 (threshold 15). Drivers by points: if/else 67 (144 pts), loops 23 (46 pts), ternaries 6 (14 pts) (nesting depth added 108). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/conversation.py"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"8f797c57896ebd6b54336fe9a913d2deaab19d4b81ab561f557ff4f4563be218"}},{"ruleId":"D2","level":"warning","message":{"text":"inference.generate_stream (cognitive 138): inference.generate_stream has cognitive complexity 138 (threshold 15). Drivers by points: if/else 44 (92 pts), ternaries 7 (28 pts), loops 4 (14 pts), boolean chains 4 (nesting depth added 79). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/inference.py"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"7720a0ed7b74fd30d3a8f82dd0bab3b567736f04782906844258254d0f6db12e"}},{"ruleId":"D2","level":"warning","message":{"text":"train_yuan2.preprocess (cognitive 121): train_yuan2.preprocess has cognitive complexity 121 (threshold 15). Drivers by points: if/else 31 (92 pts), loops 10 (25 pts), boolean chains 4 (nesting depth added 76). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_yuan2.py"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"c849243ad7c5e5c6edddacfea9f27faf27dab7b94321c85fcc0341489bd7b269"}},{"ruleId":"D2","level":"warning","message":{"text":"clean_battle_data.process_data (cognitive 79): clean_battle_data.process_data has cognitive complexity 79 (threshold 15). Drivers by points: if/else 25 (55 pts), loops 8 (16 pts), boolean chains 8 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/clean_battle_data.py"},"region":{"startLine":140}}}],"partialFingerprints":{"codehealthFindingId/v1":"c8b4e89b373df80e6e354089c7b306182dbbf4d8884a758f30a5398409c3d521"}},{"ruleId":"D2","level":"warning","message":{"text":"gen_model_answer.get_model_answers (cognitive 74): gen_model_answer.get_model_answers has cognitive complexity 74 (threshold 15). Drivers by points: if/else 15 (51 pts), loops 5 (16 pts), error handling 1 (4 pts), boolean chains 3 (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/gen_model_answer.py"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"49dcdf1dcc73f60e46cc7fe83bb81544be7e8293457bb3de3ce98a21e64487c4"}},{"ruleId":"D2","level":"warning","message":{"text":"inference.chat_loop (cognitive 69): inference.chat_loop has cognitive complexity 69 (threshold 15). Drivers by points: if/else 24 (60 pts), boolean chains 4, error handling 2 (4 pts), loops 1 (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/inference.py"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"28f4f5bfb2c5a2e9f55aeeaef8756f52dc8e45987c73e39cdb449fa7bbdcc5b8"}},{"ruleId":"D2","level":"warning","message":{"text":"api_provider.openai_assistant_api_stream_iter (cognitive 67): api_provider.openai_assistant_api_stream_iter has cognitive complexity 67 (threshold 15). Drivers by points: if/else 15 (49 pts), loops 4 (16 pts), boolean chains 2 (nesting depth added 46). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":511}}}],"partialFingerprints":{"codehealthFindingId/v1":"992ff75ee15ae769b692b04935088c6fcc790b9887cf03e7e702e50e7d24f50c"}},{"ruleId":"D2","level":"warning","message":{"text":"model_falcon.generate_stream_falcon (cognitive 50): model_falcon.generate_stream_falcon has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_falcon.py"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"98735d4f46283aa2b45160750acf6e7dee8741321c7310edcad691558c9fe6ed"}},{"ruleId":"D2","level":"warning","message":{"text":"model_yuan2.generate_stream_yuan2 (cognitive 50): model_yuan2.generate_stream_yuan2 has cognitive complexity 50 (threshold 15). Drivers by points: if/else 18 (43 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 29). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_yuan2.py"},"region":{"startLine":13}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e2bb03a85ba01d5d993a925be34b519f75deee4851ae90c63484892a14f0f43"}},{"ruleId":"D2","level":"warning","message":{"text":"model_adapter.load_model (cognitive 49): model_adapter.load_model has cognitive complexity 49 (threshold 15). Drivers by points: if/else 23 (35 pts), error handling 4 (9 pts), boolean chains 5 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_adapter.py"},"region":{"startLine":201}}}],"partialFingerprints":{"codehealthFindingId/v1":"138c54961a9ddb76a5bfa4770fed8f2c1379ba0d666014ad6b061049c94039d5"}},{"ruleId":"D2","level":"warning","message":{"text":"train_lora.train (cognitive 39): train_lora.train has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 5, ternaries 4 (5 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora.py"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"7dad9279068a930f0ad6cf48bf6526d87f3ba770132fb53f4b40168f8375d50b"}},{"ruleId":"D2","level":"warning","message":{"text":"compute_agreement.get_mt_bench_agreement (cognitive 38): compute_agreement.get_mt_bench_agreement has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 5 (14 pts), boolean chains 4 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/compute_agreement.py"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"0a888f7f7e0eaadac6d44fec0adb5a37e3197f053c50acefc7e1d12b799db362"}},{"ruleId":"D2","level":"warning","message":{"text":"compression.load_compress_model (cognitive 37): compression.load_compress_model has cognitive complexity 37 (threshold 15). Drivers by points: if/else 19 (31 pts), loops 3 (4 pts), error handling 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/compression.py"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ab93d7462d2de6f25a17ee7fd0b40857fcdb65be82535cef62591ad61cf04c1"}},{"ruleId":"D2","level":"warning","message":{"text":"monitor.load_leaderboard_table_csv (cognitive 37): monitor.load_leaderboard_table_csv has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (31 pts), loops 3 (6 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/monitor.py"},"region":{"startLine":147}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ef5ed03da7688074ddfb71968334fe5febd854768711b2d5558d2ddbc95d827"}},{"ruleId":"D2","level":"warning","message":{"text":"topic_clustering.read_texts (cognitive 35): topic_clustering.read_texts has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 2 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/topic_clustering.py"},"region":{"startLine":33}}}],"partialFingerprints":{"codehealthFindingId/v1":"0096b8d4df97edf9758c266a60b15d2c5d81b8f3f6b7d3965587f035a305c0bc"}},{"ruleId":"D2","level":"warning","message":{"text":"gradio_web_server.bot_response (cognitive 34): gradio_web_server.bot_response has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (29 pts), error handling 2, boolean chains 1, loops 1, ternaries 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_web_server.py"},"region":{"startLine":444}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa11ea4f0cc5ca69326951689655b5b07b9cad1bc25c52c4111c5cbfa495ddcb"}},{"ruleId":"D2","level":"warning","message":{"text":"LightLLMWorker.generate_stream (cognitive 33): LightLLMWorker.generate_stream has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (22 pts), ternaries 2 (5 pts), boolean chains 4, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/lightllm_worker.py"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"4d3f5512bba1bd051913b433383116c54ca044c7766c5ee470c9b0ff0165f8ac"}},{"ruleId":"D2","level":"warning","message":{"text":"filter_bad_conv.detect_type (cognitive 31): filter_bad_conv.detect_type has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/dataset_release_scripts/arena_33k/filter_bad_conv.py"},"region":{"startLine":31}}}],"partialFingerprints":{"codehealthFindingId/v1":"9375ea10a2c222492ab829fd52e7fad52c5c26927bf92628369604befc265188"}},{"ruleId":"D2","level":"warning","message":{"text":"VLLMWorker.generate_stream (cognitive 30): VLLMWorker.generate_stream has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (5 pts), boolean chains 4, ternaries 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/vllm_worker.py"},"region":{"startLine":67}}}],"partialFingerprints":{"codehealthFindingId/v1":"81d78cae7fc1d9ecda843e0606157e06be52a72a8e6ce53602ab73cd690033a8"}},{"ruleId":"D2","level":"warning","message":{"text":"train.preprocess (cognitive 29): train.preprocess has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":92}}}],"partialFingerprints":{"codehealthFindingId/v1":"28ef1fe20d823b1f9e1e9dc842662a61df1e6050d11fa7e2980904689d0a36f4"}},{"ruleId":"D2","level":"warning","message":{"text":"Controller.get_worker_address (cognitive 28): Controller.get_worker_address has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 3 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/controller.py"},"region":{"startLine":156}}}],"partialFingerprints":{"codehealthFindingId/v1":"d92520c923b9ea645a9958f953a2ec716335f088e601753138be20723acb05d8"}},{"ruleId":"D2","level":"warning","message":{"text":"DashInferWorker.generate_stream (cognitive 28): DashInferWorker.generate_stream has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (19 pts), ternaries 2 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/dashinfer_worker.py"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"14e046efccc22d95ad5e35f51a4de1e85c9c28ea258e39ff54ea171c0e3d94a6"}},{"ruleId":"D2","level":"warning","message":{"text":"api_provider.get_api_provider_stream_iter (cognitive 27): api_provider.get_api_provider_stream_iter has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":18}}}],"partialFingerprints":{"codehealthFindingId/v1":"791b42f7f3f4bbd6760153f31b29635d9d7efb8f043b0b5ef811a0f4f3caac54"}},{"ruleId":"D2","level":"warning","message":{"text":"filter_bad_conv.detect_type (cognitive 27): filter_bad_conv.detect_type has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (8 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/dataset_release_scripts/lmsys_chat_1m/filter_bad_conv.py"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"829b4d8c8b88622bf8968e527cbc1985cea8a7955d7d4a3446761b9761db31bd"}},{"ruleId":"D2","level":"warning","message":{"text":"api_provider.openai_api_stream_iter (cognitive 26): api_provider.openai_api_stream_iter has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":268}}}],"partialFingerprints":{"codehealthFindingId/v1":"1298ce79818984123cb16765ed57a3c9b886c98d9e49becf4a19265937991fbf"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_api_server.get_gen_params (cognitive 26): openai_api_server.get_gen_params has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, flatten the nesting: this score is depth rather than breadth \u2014 most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language\u0027s equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":266}}}],"partialFingerprints":{"codehealthFindingId/v1":"10c9bcb26451eba914bcf9de72cfd8cab4bf65b5da4385883d95b148ad8ffe0e"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_api_server.create_completion (cognitive 25): openai_api_server.create_completion has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (11 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":543}}}],"partialFingerprints":{"codehealthFindingId/v1":"731fc523582b948b6a50a28d356c1ca332b22042f7cd1c539552497eaa505df0"}},{"ruleId":"D2","level":"warning","message":{"text":"train_with_template.mask_targets (cognitive 25): train_with_template.mask_targets has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_with_template.py"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"fdbde4db8fa1865dd9a100094a5d7f61b1749fd7ef48f6a4d9259685e800f6a5"}},{"ruleId":"D2","level":"warning","message":{"text":"Monitor.update_stats (cognitive 24): Monitor.update_stats has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 4 (8 pts), error handling 1 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/call_monitor.py"},"region":{"startLine":25}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba03a75690042bff710e71d83ba5242fd5c4bacf991467ca9c363586e87af940"}},{"ruleId":"D2","level":"warning","message":{"text":"gradio_block_arena_vision_named.add_text (cognitive 24): gradio_block_arena_vision_named.add_text has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 5 (8 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision_named.py"},"region":{"startLine":190}}}],"partialFingerprints":{"codehealthFindingId/v1":"aeb9f02bfd614979c4213e923c7bb21c95d71bac6bbf922449ae9baa9712b46e"}},{"ruleId":"D2","level":"warning","message":{"text":"ModelWorker.get_embeddings (cognitive 24): ModelWorker.get_embeddings has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, error handling 2, loops 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/model_worker.py"},"region":{"startLine":185}}}],"partialFingerprints":{"codehealthFindingId/v1":"55328adf2f593cdd82ebe19bac2f3abacaf5a2eb4ec3e9f182cf7bd8225bb4f5"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_api_server.generate_completion_stream_generator (cognitive 24): openai_api_server.generate_completion_stream_generator has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (13 pts), loops 4 (7 pts), ternaries 1 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":621}}}],"partialFingerprints":{"codehealthFindingId/v1":"7114f5a1e07538272946b3a554a00b9ab42dfd56c6deb7defec718277377e560"}},{"ruleId":"D2","level":"warning","message":{"text":"train_lora_t5.train (cognitive 24): train_lora_t5.train has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), ternaries 4 (5 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora_t5.py"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"1bf577b6c20f8ed7d827cb285529a2dc44c1b2aaa8fc218b90af649cb7bac22f"}},{"ruleId":"D2","level":"warning","message":{"text":"common.run_judge_pair (cognitive 23): common.run_judge_pair has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (23 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/common.py"},"region":{"startLine":235}}}],"partialFingerprints":{"codehealthFindingId/v1":"bf1bfd128b468be2dbeaa7f44eae88b645def7fcc94333b65378ca7a0228c715"}},{"ruleId":"D2","level":"warning","message":{"text":"api_provider.p2l_api_stream_iter (cognitive 23): api_provider.p2l_api_stream_iter has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 2, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":428}}}],"partialFingerprints":{"codehealthFindingId/v1":"4a92dfb753f61cb66996a364a6ef0ddcabdf5b434ce0e1efb4f74fbe31f4bcd7"}},{"ruleId":"D2","level":"warning","message":{"text":"gradio_block_arena_anony.get_battle_pair (cognitive 23): gradio_block_arena_anony.get_battle_pair has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 2, loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":212}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a7a3f466a00eede7157d5cffaf1c5abb57cb630a6677a582b9ddf8a0354d525"}},{"ruleId":"D2","level":"warning","message":{"text":"monitor.build_leaderboard_tab (cognitive 23): monitor.build_leaderboard_tab has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 1 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/monitor.py"},"region":{"startLine":917}}}],"partialFingerprints":{"codehealthFindingId/v1":"664c9e018642388e9736d794c10e10df9790e259f172750218399589a11fd621"}},{"ruleId":"D2","level":"warning","message":{"text":"elo_analysis.outlier_detect (cognitive 22): elo_analysis.outlier_detect has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/elo_analysis.py"},"region":{"startLine":239}}}],"partialFingerprints":{"codehealthFindingId/v1":"3ecbc3ca74e1b9414b8db698f4f165ae77c41fb5750b2b15c00c258388730049"}},{"ruleId":"D2","level":"warning","message":{"text":"gradio_web_server.get_model_list (cognitive 21): gradio_web_server.get_model_list has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_web_server.py"},"region":{"startLine":208}}}],"partialFingerprints":{"codehealthFindingId/v1":"81c597892fbcb09efadb23681b930a5b7c91a39adb6eddb3651fbdd25ba78953"}},{"ruleId":"D2","level":"warning","message":{"text":"inspect_conv.inspect_convs (cognitive 21): inspect_conv.inspect_convs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (5 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/inspect_conv.py"},"region":{"startLine":36}}}],"partialFingerprints":{"codehealthFindingId/v1":"6cd0516450d6f9b75025eb6d14adb7e067dd20773ca3e5ebac81cabeca51fc02"}},{"ruleId":"D2","level":"warning","message":{"text":"show_result.display_result_pairwise (cognitive 20): show_result.display_result_pairwise has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/show_result.py"},"region":{"startLine":39}}}],"partialFingerprints":{"codehealthFindingId/v1":"9d7b985219f428b14b808c1b3d64618851a84e0e9e7b5cbd5035d75b014b2819"}},{"ruleId":"D2","level":"warning","message":{"text":"model_cllm.get_jacobian_trajectory (cognitive 20): model_cllm.get_jacobian_trajectory has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_cllm.py"},"region":{"startLine":21}}}],"partialFingerprints":{"codehealthFindingId/v1":"139635f64a491b98b4066443dbdaa8aec35c7f4a854273445a0e57c86e33f6a2"}},{"ruleId":"D2","level":"warning","message":{"text":"elo_analysis.report_elo_analysis_results (cognitive 20): elo_analysis.report_elo_analysis_results has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/elo_analysis.py"},"region":{"startLine":321}}}],"partialFingerprints":{"codehealthFindingId/v1":"26208ad2f597d7cc0fab4c822ed00a36ac20f99e117ab424c3e11d73466f6da2"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_api_server.chat_completion_stream_generator (cognitive 20): openai_api_server.chat_completion_stream_generator has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 3 (4 pts), ternaries 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":486}}}],"partialFingerprints":{"codehealthFindingId/v1":"e46dc3f7a607696dfcf0c0967b3f3d80d19218055695853c9dbf0ac6d30ec210"}},{"ruleId":"D2","level":"warning","message":{"text":"Conversation.to_openai_vision_api_messages (cognitive 19): Conversation.to_openai_vision_api_messages has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/conversation.py"},"region":{"startLine":383}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8e73e4be372fe3d98689b2b50d6c07cae593b56831b914ac10041582377dabe"}},{"ruleId":"D2","level":"warning","message":{"text":"clean_sharegpt.clean_html_one_sample (cognitive 19): clean_sharegpt.clean_html_one_sample has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/data/clean_sharegpt.py"},"region":{"startLine":86}}}],"partialFingerprints":{"codehealthFindingId/v1":"70a8a45069e937a9a327fae0c429cc8280a6a85813c3ee460d02e433b61ce239"}},{"ruleId":"D2","level":"warning","message":{"text":"model_cllm.generate_stream_cllm (cognitive 19): model_cllm.generate_stream_cllm has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_cllm.py"},"region":{"startLine":109}}}],"partialFingerprints":{"codehealthFindingId/v1":"a34851a75005c4837144b92871e498f8ba1fb509ebc4b3b95150b55d91c12b41"}},{"ruleId":"D2","level":"warning","message":{"text":"gradio_block_arena_anony.bot_response_multi (cognitive 19): gradio_block_arena_anony.bot_response_multi has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (5 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":358}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2b544451bf427e0e532193e0a2f3fc85ffd7b866d01a44472f132292cf5e247"}},{"ruleId":"D2","level":"warning","message":{"text":"gradio_block_arena_vision_anony.add_text (cognitive 19): gradio_block_arena_vision_anony.add_text has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 5 (8 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth \u2014 checks laid out side by side rather than stacked \u2014 so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision_anony.py"},"region":{"startLine":246}}}],"partialFingerprints":{"codehealthFindingId/v1":"ffbeca508f50a693cbbba0ce9c949c4738d937353c0b32aa1c9598d6378adadb"}},{"ruleId":"D2","level":"warning","message":{"text":"HuggingfaceApiWorker.generate_stream_gate (cognitive 19): HuggingfaceApiWorker.generate_stream_gate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 2, error handling 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/huggingface_api_worker.py"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"7eb003f3d533cb7b59fcd0a62fc44e072a0d0baf43be2b308d52ed8e16bf73a4"}},{"ruleId":"D2","level":"warning","message":{"text":"SGLWorker.generate_stream (cognitive 19): SGLWorker.generate_stream has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 3, ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/sglang_worker.py"},"region":{"startLine":81}}}],"partialFingerprints":{"codehealthFindingId/v1":"13d7f10989a4166ac64ad5c75c5823972e511d8fe71e8e18ab1d5fffbe5c6e61"}},{"ruleId":"D2","level":"warning","message":{"text":"Conversation.to_vertex_api_messages (cognitive 18): Conversation.to_vertex_api_messages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/conversation.py"},"region":{"startLine":464}}}],"partialFingerprints":{"codehealthFindingId/v1":"b47f1f6ff59de8c3a7fca58e2442c16dd32ceaffeb48ed24defbc32651249917"}},{"ruleId":"D2","level":"warning","message":{"text":"gradio_block_arena_named.bot_response_multi (cognitive 18): gradio_block_arena_named.bot_response_multi has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (5 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_named.py"},"region":{"startLine":224}}}],"partialFingerprints":{"codehealthFindingId/v1":"00b7da55d822f13ea10f1ed1414be444a2d962ee202e8e3f6f7cf54ddedbf5e2"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_api_server.check_requests (cognitive 18): openai_api_server.check_requests has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 10, if/else 8. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":180}}}],"partialFingerprints":{"codehealthFindingId/v1":"5051210bae646a4bb50a7695f28e3cfd3c268454e5559ce6d2d810ac881eac8c"}},{"ruleId":"D2","level":"warning","message":{"text":"llama_xformers_attn_monkey_patch.xformers_forward (cognitive 18): llama_xformers_attn_monkey_patch.xformers_forward has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/llama_xformers_attn_monkey_patch.py"},"region":{"startLine":23}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cd59637376b8b249f20049e0e4e5daabd1bef590279345a57296df1325d932b"}},{"ruleId":"D2","level":"warning","message":{"text":"api_provider.ai2_api_stream_iter (cognitive 17): api_provider.ai2_api_stream_iter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":846}}}],"partialFingerprints":{"codehealthFindingId/v1":"083191fc2113e268f2ddae2276053f5803921f43fd8a09138290847d0d47364f"}},{"ruleId":"D2","level":"warning","message":{"text":"MLXWorker.generate_stream (cognitive 17): MLXWorker.generate_stream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/mlx_worker.py"},"region":{"startLine":77}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a3300e882bddd495612d5938047d6b704b24f1072a5dff1aaa484d46f969ba0"}},{"ruleId":"D2","level":"warning","message":{"text":"train_lora.get_peft_state_maybe_zero_3 (cognitive 17): train_lora.get_peft_state_maybe_zero_3 has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora.py"},"region":{"startLine":79}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4315a0ad0bd0f61126916503553acd33499a6e5be55d1962283c79be665e5db"}},{"ruleId":"D2","level":"warning","message":{"text":"Conversation.to_reka_api_messages (cognitive 16): Conversation.to_reka_api_messages has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/conversation.py"},"region":{"startLine":532}}}],"partialFingerprints":{"codehealthFindingId/v1":"527b88b0bfccc81fe1c11a8cd1d30e4bea0ac9dcd2ee46dd2fd2ca36b1be0ae9"}},{"ruleId":"D2","level":"warning","message":{"text":"clean_sharegpt.clean_html_all (cognitive 16): clean_sharegpt.clean_html_all has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/data/clean_sharegpt.py"},"region":{"startLine":141}}}],"partialFingerprints":{"codehealthFindingId/v1":"be632362733c0c3d110251d843fe051bef48c3abf22db6767f2ccddf007f3cb5"}},{"ruleId":"D2","level":"warning","message":{"text":"apply_delta.apply_delta_low_cpu_mem (cognitive 16): apply_delta.apply_delta_low_cpu_mem has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/apply_delta.py"},"region":{"startLine":70}}}],"partialFingerprints":{"codehealthFindingId/v1":"68a86c7907c4121826d5c6bb3231a54827440f7f6b121a96c03e8c7010768493"}},{"ruleId":"D2","level":"warning","message":{"text":"Monitor.get_user_call_stats (cognitive 16): Monitor.get_user_call_stats has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/call_monitor.py"},"region":{"startLine":124}}}],"partialFingerprints":{"codehealthFindingId/v1":"46d21fde43612f2bbe5c0c351399ed99c6eec004a74075cd5686272ad5bae105"}},{"ruleId":"D2","level":"warning","message":{"text":"openai_api_server.create_chat_completion (cognitive 16): openai_api_server.create_chat_completion has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (5 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":412}}}],"partialFingerprints":{"codehealthFindingId/v1":"cf182bdd6659d7d538b17321e7c1857c2fd8e93e1365a6c7d0ba2c5a27d9ab63"}},{"ruleId":"D2","level":"warning","message":{"text":"train_baichuan.mask_targets (cognitive 16): train_baichuan.mask_targets has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"3cdcbead43b79c211039eb6e44be3431770dbd6905ab320bf0436f6596dfc5db"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: model/model_adapter.py: FileTooLong \u2014 1734 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1234 over it, 3.47\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_adapter.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"c10a671456d50602a59e2681b940e69f485d5b7786c5eeb3fc1c33d6c0067596"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: fastchat/conversation.py: FileTooLong \u2014 1542 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1042 over it, 3.08\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/conversation.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"2581406a41bfed60c604941d4417dc0ee05ffe0dc552baa64ce9d2af34fde790"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: serve/api_provider.py: FileTooLong \u2014 1057 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 557 over it, 2.11\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"4b3e91a2f228a5331d8e88f97b17734c1c13952a0e56f649965f042c647e4022"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: serve/openai_api_server.py: FileTooLong \u2014 702 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 202 over it, 1.40\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"78cfa8b45cba25b99616c911689cb0884d04a1dc54d0f0eac5b8f9d5b137c73d"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: model/model_registry.py: FileTooLong \u2014 698 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 198 over it, 1.40\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_registry.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"185daaa130b6803cee7b6bc7ca90801ca96d500e27783f50b409a94fbbf6f8bf"}},{"ruleId":"D3","level":"warning","message":{"text":"FileTooLong: llm_judge/common.py: FileTooLong \u2014 532 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 32 over it, 1.06\u00D7 the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/common.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"0eaaa96403b240f660a30d672b2cfd9470d44091f0ae71e5c949fb6467dcb4d5"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member family (3 members, 31 shared lines): fastchat/model/monkey_patch_non_inplace.py:40-114 | fastchat/train/llama_flash_attn_monkey_patch.py:22-85 | fastchat/train/llama_xformers_attn_monkey_patch.py:33-129 \u2014 These 3 members are variants of one another: a block of 31 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/monkey_patch_non_inplace.py"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"ce894d44cbb84b3932c4e2533e4b1f8e62ab1a850a32c922511a5902900c336e"}},{"ruleId":"D4","level":"warning","message":{"text":"Near-duplicate member pair (56 shared lines): fastchat/train/train_lora.py:105-218 | fastchat/train/train_lora_t5.py:110-222 \u2014 These two members are variants of one another: 56 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members\u0027 grain \u2014 factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora.py"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"78400b0cdf3def2e75e72e9c8fa56f477af0e3247cdfc5f6fef4ec1cab90c05a"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (26 corresponding lines): fastchat/llm_judge/qa_browser.py:126-154 | fastchat/llm_judge/qa_browser.py:158-183 \u2014 These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/qa_browser.py"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"655b79638e04fec00d35ddde4eb0ba3b8aec35e6a750c458d2bd35579787de34"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (38 corresponding lines): fastchat/serve/monitor/classify/label.py:46-89 | fastchat/serve/monitor/criteria_labeling.py:71-113 \u2014 These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/classify/label.py"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ffe472490184972fdd2d6575bb4fb9d87bc1f30671a2e13832f92cb77659273"}},{"ruleId":"D4","level":"warning","message":{"text":"Edited copy of a member (26 corresponding lines): fastchat/train/train_baichuan.py:152-177 | fastchat/train/train_with_template.py:201-226 \u2014 These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below \u2014 the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members\u0027 grain \u2014 factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":152}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c2ebf6010f8b26c5f2e904b015d188d316d6c2b17ef179d99b8c4960e5ad432"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (7 members, 50\u002B identical tokens): fastchat/serve/monitor/classify/category.py:133-140 | fastchat/serve/monitor/classify/category.py:205-212 | fastchat/serve/monitor/classify/category.py:274-281 | fastchat/serve/monitor/classify/category.py:318-325 | fastchat/serve/monitor/classify/category.py:382-389 | fastchat/serve/monitor/classify/category.py:451-458 | fastchat/serve/monitor/classify/category.py:525-532 \u2014 These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/classify/category.py"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"cbf977e9106bea05c3765279de007cf519d14f121866bf46c287247943792cd4"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (5 members, 50\u002B identical tokens): fastchat/serve/api_provider.py:279-361 | fastchat/serve/api_provider.py:438-493 | fastchat/serve/api_provider.py:693-753 | fastchat/serve/api_provider.py:924-975 | fastchat/serve/api_provider.py:1282-1347 \u2014 These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":279}}}],"partialFingerprints":{"codehealthFindingId/v1":"4ee1ba9d938202aebf538d66ac9bda9db8c79f10f945a84063f63d393b620997"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): fastchat/serve/gradio_block_arena_anony.py:143-153 | fastchat/serve/gradio_block_arena_named.py:122-132 | fastchat/serve/gradio_block_arena_vision_anony.py:214-229 | fastchat/serve/gradio_block_arena_vision_named.py:161-176 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"4989a2a8606358c495d3c96fcf12ec9d2a7858e7f3c5bfc04221e0f819260929"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): fastchat/serve/gradio_block_arena_anony.py:272-355 | fastchat/serve/gradio_block_arena_named.py:157-221 | fastchat/serve/gradio_block_arena_vision_anony.py:255-375 | fastchat/serve/gradio_block_arena_vision_named.py:199-302 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":272}}}],"partialFingerprints":{"codehealthFindingId/v1":"4773fe6139752715939e8453fd7cbef13025885e6a71e5d61878f5287ccea66b"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): fastchat/serve/lightllm_worker.py:78-186 | fastchat/serve/mlx_worker.py:78-163 | fastchat/serve/sglang_worker.py:82-162 | fastchat/serve/vllm_worker.py:68-170 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/lightllm_worker.py"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"0c942b87697739d82b631c6a3048bd27cecfaf5e23f42cdfa3895798bd03c5ce"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): fastchat/train/train.py:96-177 | fastchat/train/train_baichuan.py:81-97 | fastchat/train/train_with_template.py:81-97 | fastchat/train/train_yuan2.py:105-313 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"73843adc853d1ba25fb6ab41577bebeda38b5ca1665cc502b82010cb6e2c7c1c"}},{"ruleId":"D4","level":"warning","message":{"text":"Members sharing a duplicated core (4 members, 50\u002B identical tokens): fastchat/train/train.py:257-314 | fastchat/train/train_baichuan.py:276-329 | fastchat/train/train_with_template.py:338-396 | fastchat/train/train_yuan2.py:400-478 \u2014 These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below \u2014 it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members\u0027 grain \u2014 factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"f09b4ebdd2f5e170099cd34d9a223d8aecffec44d6d02ea8a6ec08f08deb2d3c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (85 lines \u00D7 2): fastchat/model/model_falcon.py:56-140 | fastchat/model/model_yuan2.py:55-139 \u2014 before extracting anything, compare \u0060fastchat/model/model_falcon.py\u0060 and \u0060fastchat/model/model_yuan2.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/model/model_falcon.py:56\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_falcon.py"},"region":{"startLine":56}}}],"partialFingerprints":{"codehealthFindingId/v1":"957029382c5bd000c030a93eee0fc30ec182ca8fbd67e53e4eb1354b4b6d6eee"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (48\u201349 lines \u00D7 2): fastchat/serve/gradio_block_arena_anony.py:390-438 | fastchat/serve/gradio_block_arena_named.py:254-301 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 and \u0060fastchat/serve/gradio_block_arena_named.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/gradio_block_arena_anony.py:390\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":390}}}],"partialFingerprints":{"codehealthFindingId/v1":"a577199ab7f1ddda92c4446e51763640788c0a5c49534271af59009c17092600"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (41 lines \u00D7 2): fastchat/serve/monitor/classify/category.py:461-501 | fastchat/serve/monitor/classify/category.py:535-575 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/classify/category.py"},"region":{"startLine":461}}}],"partialFingerprints":{"codehealthFindingId/v1":"edaf3945f0ab1b3fe59e11d02e68d59d04158596c0135bb80222dd01e040e922"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (29\u201339 lines \u00D7 2): fastchat/train/train_yuan2.py:168-196 | fastchat/train/train_yuan2.py:264-302 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_yuan2.py"},"region":{"startLine":168}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f871542db277f4c71fe3ccac0371b71c22127e64ebbb87357fe199737a7a20f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (37\u201338 lines \u00D7 2): fastchat/serve/monitor/classify/label.py:46-83 | fastchat/serve/monitor/criteria_labeling.py:71-107 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/classify/label.py"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"a254425f791094378b94f943d2d9842ac1849e8ca82efd8eb032d6e763be4f37"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (38 lines \u00D7 2): fastchat/train/train.py:257-294 | fastchat/train/train_yuan2.py:400-437 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_yuan2.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":257}}}],"partialFingerprints":{"codehealthFindingId/v1":"5b42f6d6113010bf4063bd8098cf4314dc25d5999c0f9ee2c3ad6ff81063bb2f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (38 lines \u00D7 2): fastchat/train/train_baichuan.py:276-313 | fastchat/train/train_with_template.py:338-375 \u2014 before extracting anything, compare \u0060fastchat/train/train_baichuan.py\u0060 and \u0060fastchat/train/train_with_template.py\u0060 as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":276}}}],"partialFingerprints":{"codehealthFindingId/v1":"1c755113882d727939163cd539c7e3c85f9fc249193ed1ef5fa34ac86ea31d88"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (36 lines \u00D7 2): fastchat/model/monkey_patch_non_inplace.py:74-109 | fastchat/train/llama_xformers_attn_monkey_patch.py:93-128 \u2014 before extracting anything, compare \u0060fastchat/model/monkey_patch_non_inplace.py\u0060 and \u0060fastchat/train/llama_xformers_attn_monkey_patch.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/monkey_patch_non_inplace.py"},"region":{"startLine":74}}}],"partialFingerprints":{"codehealthFindingId/v1":"f294b197b6d24203a2236ab3a35fea741cdb9b20c0a97c597b1f925fc11dc2c5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (30 lines \u00D7 2): fastchat/serve/monitor/monitor.py:523-552 | fastchat/serve/monitor/monitor.py:609-638 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/monitor.py"},"region":{"startLine":523}}}],"partialFingerprints":{"codehealthFindingId/v1":"55804f9fa933f22878c66e058705c0ec04e6ae0d863d426da8d738e89ec1c939"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (29 lines \u00D7 2): fastchat/serve/openai_api_server.py:437-465 | fastchat/serve/openai_api_server.py:830-858 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060request\u0060 to \u0060ChatCompletionRequest\u0060 in one and \u0060APIChatCompletionRequest\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060fastchat/serve/openai_api_server.py:466\u0060 calls \u0060isinstance\u0060, \u0060loads\u0060 and \u0060fastchat/serve/openai_api_server.py:859\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":437}}}],"partialFingerprints":{"codehealthFindingId/v1":"4cd8f092017361255ef0f058239b4474ecbf13806e88ba23c961a61353bcb098"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (25\u201326 lines \u00D7 2): fastchat/llm_judge/qa_browser.py:229-253 | fastchat/llm_judge/qa_browser.py:298-323 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/llm_judge/qa_browser.py:229\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/qa_browser.py"},"region":{"startLine":229}}}],"partialFingerprints":{"codehealthFindingId/v1":"f8c1afe794a2c079d692ee47b0c376daa09d7043f63ae54d86627d084ef2182b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (25 lines \u00D7 2): fastchat/train/train_baichuan.py:243-267 | fastchat/train/train_with_template.py:301-325 \u2014 before extracting anything, compare \u0060fastchat/train/train_baichuan.py\u0060 and \u0060fastchat/train/train_with_template.py\u0060 as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":243}}}],"partialFingerprints":{"codehealthFindingId/v1":"59bb10201d0f24f65745042ad7a08161395346a2c9ec325e8b50123f164470c6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23\u201325 lines \u00D7 2): fastchat/train/train_flant5.py:404-428 | fastchat/train/train_lora_t5.py:177-199 \u2014 before extracting anything, compare \u0060fastchat/train/train_flant5.py\u0060 and \u0060fastchat/train/train_lora_t5.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/train/train_flant5.py:404\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_flant5.py"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"221c77a969b19cb8ae1aa81dd4c8fdb568c9e13fc6bd76db51852ac84c8d717a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23\u201324 lines \u00D7 2): fastchat/serve/model_worker.py:337-360 | fastchat/serve/multi_model_worker.py:193-215 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/model_worker.py:337\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/model_worker.py"},"region":{"startLine":337}}}],"partialFingerprints":{"codehealthFindingId/v1":"562e033ef6742724123339652c228aaab7f59cf5ecb990c70455707ba27a007f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (23 lines \u00D7 2): fastchat/serve/openai_api_server.py:413-435 | fastchat/serve/openai_api_server.py:803-825 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060request\u0060 to \u0060ChatCompletionRequest\u0060 in one and \u0060APIChatCompletionRequest\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":413}}}],"partialFingerprints":{"codehealthFindingId/v1":"eff14c27f629fdd586f159579dd2e3c6bbbcfb5d575d2105854f3c077c9a08cd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22\u201323 lines \u00D7 2): fastchat/train/train_lora.py:195-217 | fastchat/train/train_lora_t5.py:198-219 \u2014 before extracting anything, compare \u0060fastchat/train/train_lora.py\u0060 and \u0060fastchat/train/train_lora_t5.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora.py"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d47b96725750b79f99f4f471dafd46aedf14a2552c83bd328ee3d6bc5adcb7b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (22 lines \u00D7 3): fastchat/model/monkey_patch_non_inplace.py:40-61 | fastchat/train/llama_flash_attn_monkey_patch.py:27-48 | fastchat/train/llama_xformers_attn_monkey_patch.py:33-54 \u2014 before extracting anything, compare \u0060fastchat/model/monkey_patch_non_inplace.py\u0060 and \u0060fastchat/train/llama_xformers_attn_monkey_patch.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060fastchat/train/llama_flash_attn_monkey_patch.py:23\u0060 calls \u0060warn\u0060 and \u0060fastchat/train/llama_xformers_attn_monkey_patch.py:31\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/monkey_patch_non_inplace.py"},"region":{"startLine":40}}}],"partialFingerprints":{"codehealthFindingId/v1":"2ef7c25152f8b49bf4fef9c18a3f7c4d08bb7f57c4d14de990acc25b8151b145"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20\u201321 lines \u00D7 5): fastchat/serve/api_provider.py:297-316 | fastchat/serve/api_provider.py:447-467 | fastchat/serve/api_provider.py:707-727 | fastchat/serve/api_provider.py:932-952 | fastchat/serve/api_provider.py:1283-1303 \u2014 all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":297}}}],"partialFingerprints":{"codehealthFindingId/v1":"7e94400d160726cc9580bfb004e295bdf20623703b65f2654b4ba783b73885b0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (21 lines \u00D7 2): fastchat/model/model_falcon.py:34-54 | fastchat/model/model_yuan2.py:34-54 \u2014 before extracting anything, compare \u0060fastchat/model/model_falcon.py\u0060 and \u0060fastchat/model/model_yuan2.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/model/model_falcon.py:34\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_falcon.py"},"region":{"startLine":34}}}],"partialFingerprints":{"codehealthFindingId/v1":"86189d1be76cfec4d72cea6498e439b34445b1e7ef8cb1d727ff2dc3740490b1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (19\u201320 lines \u00D7 3): fastchat/train/train_yuan2.py:161-179 | fastchat/train/train_yuan2.py:204-223 | fastchat/train/train_yuan2.py:256-275 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_yuan2.py"},"region":{"startLine":161}}}],"partialFingerprints":{"codehealthFindingId/v1":"fc743a55d56be24bb5206fc58cdc2752bd532b5aff8a3b3b0663c2d0ea45ad2b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (20 lines \u00D7 2): fastchat/llm_judge/gen_judgment.py:46-65 | fastchat/llm_judge/gen_judgment.py:86-105 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/gen_judgment.py"},"region":{"startLine":46}}}],"partialFingerprints":{"codehealthFindingId/v1":"c7400712bef4c394bf75a5d7b7c913f8ccee0c71c2bd4a8937aed17f3463b510"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18\u201319 lines \u00D7 2): fastchat/train/train_lora.py:135-152 | fastchat/train/train_lora_t5.py:137-155 \u2014 before extracting anything, compare \u0060fastchat/train/train_lora.py\u0060 and \u0060fastchat/train/train_lora_t5.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/train/train_lora.py:135\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora.py"},"region":{"startLine":135}}}],"partialFingerprints":{"codehealthFindingId/v1":"f4b59e4dd674921b38d2324bbb59ea44eb60192b4c8c9157ff64454eaa89de0a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 3): fastchat/serve/cli.py:200-217 | fastchat/serve/model_worker.py:366-383 | fastchat/serve/multi_model_worker.py:216-233 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from all 3 call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/cli.py"},"region":{"startLine":200}}}],"partialFingerprints":{"codehealthFindingId/v1":"d36ca3509dba8f354245bd8e2a5998c275ecc8b58062723e6b60c23f6a12b960"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): fastchat/llm_judge/qa_browser.py:204-221 | fastchat/llm_judge/qa_browser.py:277-294 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/qa_browser.py"},"region":{"startLine":204}}}],"partialFingerprints":{"codehealthFindingId/v1":"5f11b64536fffbe2c3f0f89630aff3d4a2b58651fe76dbaaacb2760f97e4d5f9"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): fastchat/serve/gradio_block_arena_anony.py:370-387 | fastchat/serve/gradio_block_arena_named.py:236-253 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 and \u0060fastchat/serve/gradio_block_arena_named.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/gradio_block_arena_anony.py:370\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":370}}}],"partialFingerprints":{"codehealthFindingId/v1":"f0702ad2fec8d1be4f4ded5fd0f7ac70bb94a7d6166f0b215243b6a7a088f9b0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17\u201318 lines \u00D7 2): fastchat/train/train.py:150-166 | fastchat/train/train_yuan2.py:232-249 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_yuan2.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":150}}}],"partialFingerprints":{"codehealthFindingId/v1":"737595a63a83c40fe4f41506c060c7125ea6f1bf45c94257170ea5adb28dc14e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (18 lines \u00D7 2): fastchat/train/train_baichuan.py:131-148 | fastchat/train/train_with_template.py:178-195 \u2014 before extracting anything, compare \u0060fastchat/train/train_baichuan.py\u0060 and \u0060fastchat/train/train_with_template.py\u0060 as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":131}}}],"partialFingerprints":{"codehealthFindingId/v1":"208d4b6aa04004889c83e99a1d0efa769eda21522e5c30afd8205bd8a684a3ad"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201317 lines \u00D7 4): fastchat/train/train.py:157-171 | fastchat/train/train_yuan2.py:185-201 | fastchat/train/train_yuan2.py:238-254 | fastchat/train/train_yuan2.py:291-307 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_yuan2.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":157}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff3bbdd1a2f3ebcaf764eb235969df0d6c745f99749a54e1f20d245b3abeb213"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (17 lines \u00D7 2): fastchat/llm_judge/qa_browser.py:138-154 | fastchat/llm_judge/qa_browser.py:167-183 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060fastchat/llm_judge/qa_browser.py:135\u0060 calls \u0060post_process_answer\u0060, \u0060strip\u0060 and \u0060fastchat/llm_judge/qa_browser.py:166\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/qa_browser.py"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"cff8344b223cf03ec535083c18ec66466db90dfd885c76cf98bc1b909b1bef68"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15\u201316 lines \u00D7 2): fastchat/serve/api_provider.py:399-414 | fastchat/serve/api_provider.py:1014-1028 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/api_provider.py:399\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":399}}}],"partialFingerprints":{"codehealthFindingId/v1":"e0529e44b04a6951cb136fe8fda5efb271e438eaad69aad0c3c8a2a75c87a077"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): fastchat/serve/gradio_block_arena_vision_anony.py:215-229 | fastchat/serve/gradio_block_arena_vision_named.py:162-176 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision_anony.py"},"region":{"startLine":215}}}],"partialFingerprints":{"codehealthFindingId/v1":"e34d807c05f28b2916e155147fc40922b4f6fe1702675b96301353fefb732b2c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): fastchat/train/train.py:300-314 | fastchat/train/train_yuan2.py:464-478 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_yuan2.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":300}}}],"partialFingerprints":{"codehealthFindingId/v1":"dbf23d1e0dcc5b4e5ad1e1e1feccd36f350b5a41863cfaf98f45a74bb82bbe4a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): fastchat/train/train_baichuan.py:163-177 | fastchat/train/train_with_template.py:212-226 \u2014 before extracting anything, compare \u0060fastchat/train/train_baichuan.py\u0060 and \u0060fastchat/train/train_with_template.py\u0060 as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/train/train_baichuan.py:163\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":163}}}],"partialFingerprints":{"codehealthFindingId/v1":"183254c11800e93534efb50145ae44b19de5ed9191cc12ae1ba45046fd907f1c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (15 lines \u00D7 2): fastchat/train/train_lora.py:118-132 | fastchat/train/train_lora_t5.py:120-134 \u2014 before extracting anything, compare \u0060fastchat/train/train_lora.py\u0060 and \u0060fastchat/train/train_lora_t5.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060fastchat/train/train_lora.py:116\u0060 calls \u0060replace_llama_attn_with_flash_attn\u0060 and \u0060fastchat/train/train_lora_t5.py:118\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora.py"},"region":{"startLine":118}}}],"partialFingerprints":{"codehealthFindingId/v1":"ea28bce410fd7398c357b1a41001f117a0350f132ec579075fab369afd57a36b"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 3): fastchat/serve/lightllm_worker.py:95-108 | fastchat/serve/mlx_worker.py:94-107 | fastchat/serve/vllm_worker.py:86-99 \u2014 before extracting anything, compare \u0060fastchat/serve/mlx_worker.py\u0060 and \u0060fastchat/serve/vllm_worker.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/lightllm_worker.py"},"region":{"startLine":95}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0a27f2e9288b4976f948630b5b3ac3d4bf1e554cabc2c19282a28f4b1271446"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): fastchat/model/model_adapter.py:1848-1861 | fastchat/model/model_adapter.py:1879-1892 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060fastchat/model/model_adapter.py:1863\u0060 calls \u0060eval\u0060 and \u0060fastchat/model/model_adapter.py:1893\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_adapter.py"},"region":{"startLine":1848}}}],"partialFingerprints":{"codehealthFindingId/v1":"04d9d90a437852967ac1eb26fc5912262a7338dcbe6c476c5b2c85e8c44da47c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): fastchat/model/model_adapter.py:1998-2011 | fastchat/model/model_adapter.py:2032-2045 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_adapter.py"},"region":{"startLine":1998}}}],"partialFingerprints":{"codehealthFindingId/v1":"8bd325eb62ba7311245c9a07e2293c64fc392f861dae403cf11e1bc51bd9f1bd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (14 lines \u00D7 2): fastchat/serve/monitor/classify/category.py:164-177 | fastchat/serve/monitor/classify/category.py:236-249 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/classify/category.py"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"79060f681db37b5241105f219c45af4f68d381882aa111a78fb5bded7a2cb17d"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): fastchat/llm_judge/gen_judgment.py:138-150 | fastchat/llm_judge/gen_judgment.py:154-166 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/gen_judgment.py"},"region":{"startLine":138}}}],"partialFingerprints":{"codehealthFindingId/v1":"8311712918e94ff3c079e9ff0feee475fdf675be5c6625230463ead5acb87541"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (13 lines \u00D7 2): fastchat/serve/monitor/topic_clustering.py:133-145 | fastchat/serve/monitor/topic_clustering.py:156-168 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/topic_clustering.py"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"b4c93d554e46c8bed4d94b2a390ff9d0adfd24bb9ce980969ae2861d5cce0f97"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (12 lines \u00D7 2): fastchat/serve/openai_api_server.py:508-519 | fastchat/serve/openai_api_server.py:644-655 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":508}}}],"partialFingerprints":{"codehealthFindingId/v1":"a2f5c520c8b08a8b0d7ab558f70de7d288a5e453d246553c08454a0a954ef6e2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 4): fastchat/train/train.py:100-110 | fastchat/train/train_baichuan.py:83-92 | fastchat/train/train_with_template.py:83-92 | fastchat/train/train_yuan2.py:109-119 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_baichuan.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":100}}}],"partialFingerprints":{"codehealthFindingId/v1":"e57debe72eb5beb14f05385df0e7350f2c6014baa2bfb4821458d100ea34e46a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 4): fastchat/train/train.py:270-280 | fastchat/train/train_baichuan.py:287-296 | fastchat/train/train_with_template.py:349-358 | fastchat/train/train_yuan2.py:413-423 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_baichuan.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/train/train.py:270\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":270}}}],"partialFingerprints":{"codehealthFindingId/v1":"b13fa9f9d9112ad6b10966b971797635ba093c0b021e82a9c1712940504ac68e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10\u201311 lines \u00D7 3): fastchat/train/train_baichuan.py:319-329 | fastchat/train/train_flant5.py:423-432 | fastchat/train/train_with_template.py:386-396 \u2014 before extracting anything, compare \u0060fastchat/train/train_baichuan.py\u0060 and \u0060fastchat/train/train_with_template.py\u0060 as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/train/train_baichuan.py:319\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060fastchat/train/train_flant5.py:422\u0060 calls \u0060make_supervised_data_module\u0060, \u0060Trainer\u0060 and \u0060fastchat/train/train_with_template.py:386\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"963ef16110099f3545c57e528454269c159d9a0f1dadd517d06722276a184111"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): fastchat/llm_judge/common.py:222-232 | fastchat/llm_judge/common.py:394-404 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/llm_judge/common.py:222\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/common.py"},"region":{"startLine":222}}}],"partialFingerprints":{"codehealthFindingId/v1":"2afb39786ab9efd5a2994fc320ae14328e76b9c6d1f697f39eedb7cb2199af2c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): fastchat/serve/gradio_block_arena_anony.py:338-348 | fastchat/serve/gradio_block_arena_vision_anony.py:358-368 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 and \u0060fastchat/serve/gradio_block_arena_vision_anony.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/gradio_block_arena_anony.py:338\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060fastchat/serve/gradio_block_arena_vision_anony.py:355\u0060 calls \u0060_prepare_text_with_image\u0060 and \u0060fastchat/serve/gradio_block_arena_anony.py:337\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":338}}}],"partialFingerprints":{"codehealthFindingId/v1":"a0ad68b29162926f20ecd188ad780b829746856f253d7d2eb7ac679d3863287c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (11 lines \u00D7 2): fastchat/serve/monitor/classify/category.py:68-78 | fastchat/serve/monitor/criteria_labeling.py:57-67 \u2014 the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach \u2014 a location they all depend on today, or a new shared one if there is none \u2014 and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/classify/category.py"},"region":{"startLine":68}}}],"partialFingerprints":{"codehealthFindingId/v1":"5242402b140875d9a80611b375d529ba64bccaaa81a0424b45333d4a241f783f"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 4): fastchat/train/train.py:297-306 | fastchat/train/train_flant5.py:422-430 | fastchat/train/train_lora_t5.py:192-201 | fastchat/train/train_yuan2.py:461-470 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_yuan2.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":297}}}],"partialFingerprints":{"codehealthFindingId/v1":"641bdf0e0d6eb8e3772508d17de2a4e3c4fd1a909c1ac76521f579c53fa5c6d1"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 3): fastchat/model/monkey_patch_non_inplace.py:63-72 | fastchat/train/llama_flash_attn_monkey_patch.py:50-58 | fastchat/train/llama_xformers_attn_monkey_patch.py:59-68 \u2014 before extracting anything, compare \u0060fastchat/model/monkey_patch_non_inplace.py\u0060 and \u0060fastchat/train/llama_xformers_attn_monkey_patch.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/model/monkey_patch_non_inplace.py:63\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/monkey_patch_non_inplace.py"},"region":{"startLine":63}}}],"partialFingerprints":{"codehealthFindingId/v1":"ff56c58cdd19cce5d30e8dbba4cb007d273f3a13128bd5579b07d8ed02859e6e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): fastchat/llm_judge/common.py:417-426 | fastchat/llm_judge/common.py:450-459 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/llm_judge/common.py:417\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/common.py"},"region":{"startLine":417}}}],"partialFingerprints":{"codehealthFindingId/v1":"942f79a343aec9930edb0cfb6ef2395ffbae4506e49a299e414e1e26ddbb1938"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): fastchat/modules/awq.py:76-85 | fastchat/modules/gptq.py:66-75 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/modules/awq.py"},"region":{"startLine":76}}}],"partialFingerprints":{"codehealthFindingId/v1":"8a921fc1f22a7b17333ba141068caad0492e3625fabf76332668068408d801b5"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): fastchat/serve/cli.py:62-71 | fastchat/serve/cli.py:177-186 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/cli.py"},"region":{"startLine":62}}}],"partialFingerprints":{"codehealthFindingId/v1":"17c560718f75cd4f2d8da239babedec75f39aa8ea41c50e146211376fc6f4f40"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): fastchat/serve/gradio_block_arena_named.py:174-183 | fastchat/serve/gradio_block_arena_vision_named.py:237-246 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_named.py\u0060 and \u0060fastchat/serve/gradio_block_arena_vision_named.py\u0060 as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/gradio_block_arena_named.py:174\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_named.py"},"region":{"startLine":174}}}],"partialFingerprints":{"codehealthFindingId/v1":"3bccb485294675977dc2094c68ac9f74feb86c2cd734c34b87e4f07909748a0e"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): fastchat/serve/mlx_worker.py:85-94 | fastchat/serve/vllm_worker.py:75-84 \u2014 before extracting anything, compare \u0060fastchat/serve/mlx_worker.py\u0060 and \u0060fastchat/serve/vllm_worker.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060fastchat/serve/vllm_worker.py:86\u0060 calls \u0060get\u0060 and \u0060fastchat/serve/mlx_worker.py:97\u0060 does not \u2014 after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/mlx_worker.py"},"region":{"startLine":85}}}],"partialFingerprints":{"codehealthFindingId/v1":"26b5c2f95be4550436641c0f81dff3982822e2f02ccc60067a925abac65b7190"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9\u201310 lines \u00D7 2): fastchat/serve/model_worker.py:305-313 | fastchat/serve/multi_model_worker.py:162-171 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/model_worker.py:305\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/model_worker.py"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"78c4a70f9ef83eb21ff9db60e8995f98b1cd397ef13cd05feca1c062d2f8c80c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): fastchat/train/train.py:126-135 | fastchat/train/train_baichuan.py:113-122 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_baichuan.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e889e2511dfdac471ae3f84dcfbc064b5774be10de79987dc759877dbe4430a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (10 lines \u00D7 2): fastchat/train/train_baichuan.py:228-237 | fastchat/train/train_with_template.py:283-292 \u2014 before extracting anything, compare \u0060fastchat/train/train_baichuan.py\u0060 and \u0060fastchat/train/train_with_template.py\u0060 as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/train/train_baichuan.py:228\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":228}}}],"partialFingerprints":{"codehealthFindingId/v1":"5d2a019e4d4a6d622952c5f2c56fca64ca244c1822f4472f9c5e8bedbcfee729"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 3): fastchat/serve/gradio_block_arena_anony.py:305-313 | fastchat/serve/gradio_block_arena_named.py:178-185 | fastchat/serve/gradio_block_arena_vision_named.py:241-248 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 and \u0060fastchat/serve/gradio_block_arena_named.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/gradio_block_arena_anony.py:305\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":305}}}],"partialFingerprints":{"codehealthFindingId/v1":"dc04e3135ed792ebced6c6397cf8dd832ebb52eb49d99e6132badd78f614f4bb"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 3): fastchat/train/train_baichuan.py:319-328 | fastchat/train/train_flant5.py:423-431 | fastchat/train/train_lora_t5.py:194-202 \u2014 before extracting anything, compare \u0060fastchat/train/train_flant5.py\u0060 and \u0060fastchat/train/train_lora_t5.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/train/train_baichuan.py:319\u0060 it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"fcf82abdd9d4281d9adbede89a9a5dfbe7cbf8a9d94d63f1c8021c77cd0c6cf8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8\u20139 lines \u00D7 2): fastchat/llm_judge/common.py:136-143 | fastchat/llm_judge/common.py:236-244 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/common.py"},"region":{"startLine":136}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3a0253284798363c1d70073635cc1c96275a2e0c6319ed5a0618cc9df34bd19"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): fastchat/llm_judge/qa_browser.py:129-137 | fastchat/llm_judge/qa_browser.py:161-169 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060fastchat/llm_judge/qa_browser.py:138\u0060 calls \u0060post_process_answer\u0060, \u0060strip\u0060 and \u0060fastchat/llm_judge/qa_browser.py:171\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/qa_browser.py"},"region":{"startLine":129}}}],"partialFingerprints":{"codehealthFindingId/v1":"b246b6c4db823a509cad897203e18ea2bc412fdd7ff20e2a8af6b2b30a71aa45"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): fastchat/serve/gradio_block_arena_anony.py:144-152 | fastchat/serve/gradio_block_arena_named.py:123-131 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 and \u0060fastchat/serve/gradio_block_arena_named.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":144}}}],"partialFingerprints":{"codehealthFindingId/v1":"5247ff1db2eae2f741a0635dd3f86a04c28c0087080f57f18d188dc91ebd73a3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): fastchat/serve/inference.py:425-433 | fastchat/serve/inference.py:438-446 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/inference.py"},"region":{"startLine":425}}}],"partialFingerprints":{"codehealthFindingId/v1":"5e2fc136bec8c75447b61e9f547813fc22f80f80120aac62a3f272d40eba21b2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): fastchat/serve/monitor/basic_stats.py:142-150 | fastchat/serve/monitor/basic_stats.py:153-161 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/basic_stats.py"},"region":{"startLine":142}}}],"partialFingerprints":{"codehealthFindingId/v1":"4e5396ce652bfd22368194bdcd9c02d6f5a68ff9df888e1444514ef1dd31a8df"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): fastchat/serve/openai_api_server.py:469-477 | fastchat/serve/openai_api_server.py:859-867 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":469}}}],"partialFingerprints":{"codehealthFindingId/v1":"ba87c352e0fb3aebe297442e15bf1696acc0520d5e567d301f39d98c23a33721"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 7): fastchat/serve/monitor/classify/category.py:133-140 | fastchat/serve/monitor/classify/category.py:205-212 | fastchat/serve/monitor/classify/category.py:274-281 | fastchat/serve/monitor/classify/category.py:318-325 | fastchat/serve/monitor/classify/category.py:382-389 | fastchat/serve/monitor/classify/category.py:451-458 | fastchat/serve/monitor/classify/category.py:525-532 \u2014 all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/classify/category.py"},"region":{"startLine":133}}}],"partialFingerprints":{"codehealthFindingId/v1":"d2c0a14c1d99bc4d6412ada213f9f586024c16d73210af674b6eff250815beb3"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6\u20138 lines \u00D7 4): fastchat/serve/gradio_block_arena_anony.py:143-148 | fastchat/serve/gradio_block_arena_named.py:122-127 | fastchat/serve/gradio_block_arena_vision_anony.py:214-221 | fastchat/serve/gradio_block_arena_vision_named.py:161-168 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 and \u0060fastchat/serve/gradio_block_arena_named.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/gradio_block_arena_anony.py:143\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names \u2014 the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":143}}}],"partialFingerprints":{"codehealthFindingId/v1":"997f3c7474d3c1ec5aacc739adbc2ef66a6dd4106930cc351f24c13ed366a384"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 3): fastchat/serve/lightllm_worker.py:78-85 | fastchat/serve/mlx_worker.py:78-85 | fastchat/serve/vllm_worker.py:68-75 \u2014 before extracting anything, compare \u0060fastchat/serve/mlx_worker.py\u0060 and \u0060fastchat/serve/vllm_worker.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060fastchat/serve/lightllm_worker.py:87\u0060 calls \u0060get\u0060 and \u0060fastchat/serve/mlx_worker.py:87\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/lightllm_worker.py"},"region":{"startLine":78}}}],"partialFingerprints":{"codehealthFindingId/v1":"49a0fb01a23d671cfd47b99a112e206056fb2fd7629d1144e80f2f5372c291ea"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): fastchat/conversation.py:443-450 | fastchat/conversation.py:588-595 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/conversation.py"},"region":{"startLine":443}}}],"partialFingerprints":{"codehealthFindingId/v1":"c2812e751f9561e6971359659364bfa6ca224b994ff65f902ef44c6ccf2909f0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): fastchat/serve/gradio_block_arena_anony.py:320-327 | fastchat/serve/gradio_block_arena_vision_anony.py:318-325 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 and \u0060fastchat/serve/gradio_block_arena_vision_anony.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/gradio_block_arena_anony.py:320\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":320}}}],"partialFingerprints":{"codehealthFindingId/v1":"5536c9efc1e52432e077a9d78663b11268dc94c704ed01f0b15b5517a6d34bb8"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): fastchat/serve/gradio_block_arena_named.py:192-199 | fastchat/serve/gradio_block_arena_vision_named.py:256-263 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_named.py\u0060 and \u0060fastchat/serve/gradio_block_arena_vision_named.py\u0060 as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/gradio_block_arena_named.py:192\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_named.py"},"region":{"startLine":192}}}],"partialFingerprints":{"codehealthFindingId/v1":"9dd0cc8a2022264c8878ef22206625c5ea72d5f7522bd68bb52ab4ea50b36aa6"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): fastchat/serve/mlx_worker.py:83-89 | fastchat/serve/sglang_worker.py:87-93 | fastchat/serve/vllm_worker.py:73-79 \u2014 before extracting anything, compare \u0060fastchat/serve/mlx_worker.py\u0060 and \u0060fastchat/serve/vllm_worker.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/mlx_worker.py"},"region":{"startLine":83}}}],"partialFingerprints":{"codehealthFindingId/v1":"aa6b029ff9fd5255a5212636cf21246f6b19ff977ad3df03b05289bb872814cd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 3): fastchat/serve/openai_api_server.py:457-463 | fastchat/serve/openai_api_server.py:588-597 | fastchat/serve/openai_api_server.py:850-856 \u2014 all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites \u2014 resolving only two of them leaves the rest to drift apart the first time one is edited. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on. Note first that the copies are not typed on the same thing: the declarations holding them bind \u0060request\u0060 to \u0060ChatCompletionRequest\u0060 in one and \u0060CompletionRequest\u0060 in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH \u2014 their common supertype where they have one, or a new abstraction over them where they do not \u2014 and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":457}}}],"partialFingerprints":{"codehealthFindingId/v1":"29ff074a5f1daab4855d1d8bff0b522528053b757dbff927801555e9aa3adfb2"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): fastchat/llm_judge/compute_agreement.py:112-118 | fastchat/llm_judge/compute_agreement.py:120-126 \u2014 both copies are in the same file, so extract the block into one function there and call it from each site \u2014 the copies drift apart the first time only one of them is edited."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/compute_agreement.py"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"d638f974b8ca203004bfc13a74fb368446671ac1c65ddd5522dd58ab9a20b731"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): fastchat/serve/gradio_block_arena_named.py:209-215 | fastchat/serve/gradio_block_arena_vision_named.py:290-296 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_named.py\u0060 and \u0060fastchat/serve/gradio_block_arena_vision_named.py\u0060 as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at \u0060fastchat/serve/gradio_block_arena_named.py:209\u0060 it does not close everything it opens, so those exact lines cannot be lifted as they stand \u2014 widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, \u0060fastchat/serve/gradio_block_arena_vision_named.py:287\u0060 calls \u0060_prepare_text_with_image\u0060 and \u0060fastchat/serve/gradio_block_arena_named.py:208\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_named.py"},"region":{"startLine":209}}}],"partialFingerprints":{"codehealthFindingId/v1":"6d3ac479c7c3405bcfea287ccb1daf57687dc1df5eb62d164918c2eeae8b579c"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (7 lines \u00D7 2): fastchat/serve/huggingface_api_worker.py:282-288 | fastchat/serve/model_worker.py:304-310 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060fastchat/serve/model_worker.py:311\u0060 calls \u0060add_model_args\u0060 and \u0060fastchat/serve/huggingface_api_worker.py:290\u0060 does not \u2014 after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/huggingface_api_worker.py"},"region":{"startLine":282}}}],"partialFingerprints":{"codehealthFindingId/v1":"2bac68935729db22d704cdd0f4bcbfc70bb8d545cd3b00011af54c0e3db41283"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 2): fastchat/serve/gradio_block_arena_vision.py:137-142 | fastchat/serve/gradio_web_server.py:327-332 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision.py"},"region":{"startLine":137}}}],"partialFingerprints":{"codehealthFindingId/v1":"0872f0bbfe3d8679e833c2c2d75a3d14ce83aea821d94659f9904816d497f0fd"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 3): fastchat/model/model_falcon.py:22-26 | fastchat/model/model_yuan2.py:22-26 | fastchat/serve/inference.py:75-79 \u2014 before extracting anything, compare \u0060fastchat/model/model_falcon.py\u0060 and \u0060fastchat/model/model_yuan2.py\u0060 as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_falcon.py"},"region":{"startLine":22}}}],"partialFingerprints":{"codehealthFindingId/v1":"ec66f69fbf1db9f9fe258d12237d236c5c6db699d1363722a988edb7545e6d72"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): fastchat/model/model_chatglm.py:75-79 | fastchat/model/model_codet5p.py:23-27 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_chatglm.py"},"region":{"startLine":75}}}],"partialFingerprints":{"codehealthFindingId/v1":"c51dab55774f4ceef36330c524a9f79dd851d33e18a8c80e7c68a4627ac24cf0"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): fastchat/serve/gradio_block_arena_vision_anony.py:354-358 | fastchat/serve/gradio_block_arena_vision_named.py:286-290 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision_anony.py"},"region":{"startLine":354}}}],"partialFingerprints":{"codehealthFindingId/v1":"f67956d54749306240513e1ebcb5e359e722b85236c64902fad54227e52b25a4"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): fastchat/serve/base_model_worker.py:198-202 | fastchat/serve/sglang_worker.py:199-203 \u2014 the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach \u2014 a file they already depend on, or a new one alongside them \u2014 and call it from both call sites, so a change lands once. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/base_model_worker.py"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"f2b928274c648ff24ba46799b610643632ef075c17978a8fb3c591701da7ccdf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 8): fastchat/serve/gradio_block_arena_anony.py:105-109 | fastchat/serve/gradio_block_arena_anony.py:115-119 | fastchat/serve/gradio_block_arena_anony.py:125-129 | fastchat/serve/gradio_block_arena_anony.py:135-139 | fastchat/serve/gradio_block_arena_vision_anony.py:176-180 | fastchat/serve/gradio_block_arena_vision_anony.py:186-190 | fastchat/serve/gradio_block_arena_vision_anony.py:196-200 | fastchat/serve/gradio_block_arena_vision_anony.py:206-210 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 and \u0060fastchat/serve/gradio_block_arena_vision_anony.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":105}}}],"partialFingerprints":{"codehealthFindingId/v1":"45e9730c03f889b0566d9ac6c12073d3f22cec26fc1557631ba77a1d6d8edd75"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 2): fastchat/serve/gradio_block_arena_anony.py:171-175 | fastchat/serve/gradio_block_arena_named.py:147-151 \u2014 before extracting anything, compare \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 and \u0060fastchat/serve/gradio_block_arena_named.py\u0060 as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_anony.py"},"region":{"startLine":171}}}],"partialFingerprints":{"codehealthFindingId/v1":"7c41b319111d37be61049befb6b6fe0644d8669c9026d3581a141f5dc372b362"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (5 lines \u00D7 4): fastchat/train/train.py:198-202 | fastchat/train/train_baichuan.py:200-204 | fastchat/train/train_with_template.py:251-255 | fastchat/train/train_yuan2.py:336-340 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_baichuan.py\u0060 as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":198}}}],"partialFingerprints":{"codehealthFindingId/v1":"20e6d64786d3b85185be56c65effed4329716ba0a6d23353dbee78b24449093a"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (8 lines \u00D7 2): fastchat/train/train.py:82-89 | fastchat/train/train_yuan2.py:85-92 \u2014 before extracting anything, compare \u0060fastchat/train/train.py\u0060 and \u0060fastchat/train/train_yuan2.py\u0060 as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 133 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. \u2605 These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, \u0060fastchat/train/train_yuan2.py:96\u0060 calls \u0060right_replace\u0060, \u0060replace\u0060 and \u0060fastchat/train/train.py:92\u0060 does not \u2014 after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train.py"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"27ea6302fab9b979659daedc99acd919d90af0f599754d1c6e1475f3431179bf"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (6 lines \u00D7 3): fastchat/train/train_baichuan.py:72-77 | fastchat/train/train_flant5.py:76-81 | fastchat/train/train_with_template.py:72-77 \u2014 before extracting anything, compare \u0060fastchat/train/train_baichuan.py\u0060 and \u0060fastchat/train/train_with_template.py\u0060 as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"f576ea7f6e4127739a04539957603ecd0e9153c482b80453a1bd298375914d82"}},{"ruleId":"D4","level":"warning","message":{"text":"Duplicated block (9 lines \u00D7 2): fastchat/train/train_baichuan.py:101-109 | fastchat/train/train_with_template.py:101-109 \u2014 before extracting anything, compare \u0060fastchat/train/train_baichuan.py\u0060 and \u0060fastchat/train/train_with_template.py\u0060 as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 159 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together \u2014 extracting one helper per block leaves the fork in place. The \u0060return\u0060 at the foot of the matched lines is the enclosing body\u0027s own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that \u0060return\u0060 occupied \u2014 no decision has to be handed back and re-acted on."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_baichuan.py"},"region":{"startLine":101}}}],"partialFingerprints":{"codehealthFindingId/v1":"ca23fbeee60c75d2e4c11c8d855a99e63a842a79da4c450b77a93cfb59080413"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: ChatGLM stop when it reach max length \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_chatglm.py"},"region":{"startLine":126}}}],"partialFingerprints":{"codehealthFindingId/v1":"4549a6dd73a90480d4e752ac62745c820d2ad016e8234460e5edab3de7468114"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO (lmzheng): make it a priority queue. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_adapter.py"},"region":{"startLine":148}}}],"partialFingerprints":{"codehealthFindingId/v1":"f033613e3943a8947c65d72c6f2346688f02f92daf5561adff997ad274e979b6"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # Apply monkey patch, TODO(Dacheng): Add flash attention support \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_adapter.py"},"region":{"startLine":782}}}],"partialFingerprints":{"codehealthFindingId/v1":"f23e1fbcfb41958076e113322c64a30088ea5aabdf3b510f054c270b136f3b44"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: use the recommended template for 7B \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_adapter.py"},"region":{"startLine":1313}}}],"partialFingerprints":{"codehealthFindingId/v1":"d4ce1d64e66ffecf207f490ab95972aa8e0e0e697773fd8ffb65d7340b64e854"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(chris): Implement huggingface-compatible load_model \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_adapter.py"},"region":{"startLine":2355}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7df2730a69f3ec17d10537d2d7a574869dc7d379dd4e0429b91fac122dad34a"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(chris): This only applies to LLaVA model. Implement an image_token string in the conv template. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":319}}}],"partialFingerprints":{"codehealthFindingId/v1":"395ea876c4caa53fcc4bfbf6e4b0cf5c4ec86f1b268f5e3fe9cfb34f1d91f66b"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: return real model permission details \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":404}}}],"partialFingerprints":{"codehealthFindingId/v1":"a7dbf12839d9908d8d60f9143b08593d0dda6b5d9262f383efa4dc734219d72f"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # todo: index is not apparent \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/openai_api_server.py"},"region":{"startLine":656}}}],"partialFingerprints":{"codehealthFindingId/v1":"eed2081e554ef78d5999972347cf124e899ba3d4453d558b83bd9c29e65966e4"}},{"ruleId":"D17","level":"warning","message":{"text":"FixmeComment: # FIXME: Support logprobs\u003E1. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/inference.py"},"region":{"startLine":82}}}],"partialFingerprints":{"codehealthFindingId/v1":"b906b1018f721885200764ba7f0d2dede09a7f40981474954f7b8daf0828296e"}},{"ruleId":"D17","level":"warning","message":{"text":"FixmeComment: # FIXME: Support logprobs for encoder-decoder models. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/inference.py"},"region":{"startLine":104}}}],"partialFingerprints":{"codehealthFindingId/v1":"95f707052caedcc5d698a0ca2f656d53c01e24bf0c4e719717084f5edb4bf9bb"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: For the issue of incomplete sentences interrupting output, apply a patch and others can also modify it to a more elegant way \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/inference.py"},"region":{"startLine":242}}}],"partialFingerprints":{"codehealthFindingId/v1":"37b730d44cc81e997a41b5edd1332add9ade92293dd9c247ce6c39039309df64"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(chris): fix sampling weights \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision_anony.py"},"region":{"startLine":87}}}],"partialFingerprints":{"codehealthFindingId/v1":"5054c0290a6db102e8311d755981976d0ce346beca7f2285df8e406c2ce9c7e2"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(chris): Find battle targets that make sense \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision_anony.py"},"region":{"startLine":90}}}],"partialFingerprints":{"codehealthFindingId/v1":"34156ff232b65db2b8620cefe0ea5ee18667b339fa4fd3fd1b73187893a7eaad"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(chris): Fill out models that require sampling boost \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision_anony.py"},"region":{"startLine":93}}}],"partialFingerprints":{"codehealthFindingId/v1":"49979921e54f0c396118eeaf43cb2fa9a5fa2f07f92a377e1d6e8963033e6336"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(Chris): At some point, we would like this to be a live-reporting feature. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision.py"},"region":{"startLine":164}}}],"partialFingerprints":{"codehealthFindingId/v1":"f10f06235845d046474823376639894bc55721cd924bb2648bf02653d966b91e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(suquark): multiline input has some issues. fix it later. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/cli.py"},"region":{"startLine":96}}}],"partialFingerprints":{"codehealthFindingId/v1":"5a0bfaf6d5a8c161db2f34e58ec387a01f9ec0356176dcdd547c77373051d253"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(suquark): the console flickers when there is a code block \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/cli.py"},"region":{"startLine":112}}}],"partialFingerprints":{"codehealthFindingId/v1":"d1de9eef3747f071984d2c0492fd6aa277c54353467a77c54c9871267f749bb1"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: this sometimes happens, need to investigate what happens. in theory the chat dict should be synced with the queue, unless there are duplicated items \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/vote_time_stats/analyze_data.py"},"region":{"startLine":41}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3ab5d5b2a9a817d892a691c93aeefcbf3e415f126b995f28406ed9a19283027"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: add the string length of the last reply for analyzing voting time per character. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/vote_time_stats/analyze_data.py"},"region":{"startLine":47}}}],"partialFingerprints":{"codehealthFindingId/v1":"9c24711c6252bca699d8b57b121c2b651f221427babbc887307f1f07dbc90973"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: this sometimes happens, it means we have the vote but we cannot find previous chat, need to investigate what happens \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/vote_time_stats/analyze_data.py"},"region":{"startLine":59}}}],"partialFingerprints":{"codehealthFindingId/v1":"6f070add1f56422a16e55491dfcb5bb27b5d4a6b38a716f1649527db4d783426"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: change this to select different range of data \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/vote_time_stats/analyze_data.py"},"region":{"startLine":116}}}],"partialFingerprints":{"codehealthFindingId/v1":"5fa7be3cac6aac7fb2d6e3a0d9031e27188f2c8cb7c835c24d229325145baf4e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: import and use code from ../data/dataset.py \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_lora_t5.py"},"region":{"startLine":49}}}],"partialFingerprints":{"codehealthFindingId/v1":"f80e40c59e8940b9a899dc79bf4db70fcf4998da12f71de6d46f8e33853bd068"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO: import and use code from ../data/dataset.py \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_flant5.py"},"region":{"startLine":37}}}],"partialFingerprints":{"codehealthFindingId/v1":"48818042bcfc640a0b4630cb205c2d465dece2395d2ea14edb2acea6581737d2"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(Dacheng): verify this is a good way to split sentences \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_flant5.py"},"region":{"startLine":195}}}],"partialFingerprints":{"codehealthFindingId/v1":"2dae37e43485053e8f072b95b3fe7884486f43f99ba150f67c5c0b73d34b8f2e"}},{"ruleId":"D17","level":"warning","message":{"text":"TodoComment: # TODO(Dacheng): This is related to whether the dataset has been truncated.. \u2014 source code is not a task system: move the work to your tracker and leave a reference instead (e.g. \u0060# REF: #123\u0060), so the task is planned where tasks live and the ticket links back to the code."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/train/train_flant5.py"},"region":{"startLine":238}}}],"partialFingerprints":{"codehealthFindingId/v1":"7788dce6a8455d01c1c3a177d697e393a48daaa10d05d27c6b5f2e71556611dc"}},{"ruleId":"D19","level":"note","message":{"text":"Documentation: no architecture or design documentation: The document describes prompt-template and adapter implementation steps but there are no architecture or design docs covering how FastChat workers interact with the OpenAI API server. Link to an architecture doc showing the model-worker pipeline, controller role, and REST API integration flow."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"docs/model_support.md"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"23fced92bf530b550d0fd337881f4747975d8c35039d79dda669228e98352c7b"}},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"4fadc1c8e939673fb181909e8d64b43c3e0d147256ca192c768587f2c97d09ed"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"0373c55bb073fb3bb14dad5f1a800b1e04a42309a50b0e5f27267bcca21130a7"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"67919650bcf9860776abbcc4ded1b9b09e2294f3ab2d30fe108dd540a3df75fc"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-829","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"441fb53588b2d0d19ba6223c0c520b71c8cb6d342a7b838068eefabb75ab51d3"},"taxa":[{"id":"CWE-1104","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-1329","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ce9aca4b177161dd2b498a4955f339aca2990fd31b71b9c8840ec4ec6ffa978d"},"taxa":[{"id":"CWE-1104","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-1329","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9e945b30fa1a3ea369c1c74e611c2bb4774bc17b9751c0a68fa78d94d0896f65"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"5ac91f9644b281215747e40ea3e27f6512d41512e15b77b9915a5fb61d830b07"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9de58b6ea3668fc7d050407bbec98b439a3506839facea4cb9be914c0ed83b12"},"taxa":[{"id":"CWE-327","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"86c269e001439be31ba739d27e284966ca780295accc38b16176591f7f403b0c"},"taxa":[{"id":"CWE-502","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"b5b67b32188548202ba877f2833d0680ee6dba7e4fb8d6448441b22bc158a575"},"taxa":[{"id":"CWE-502","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"26d11ea7974f124b43b8186fef771e55ae2d9a960104785788add00515d6fe2d"},"taxa":[{"id":"CWE-502","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"7d78862f6d8bc8f48f5b7470176fa6e067dc69c6e37295074937a272029a2a4c"},"taxa":[{"id":"CWE-502","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"a519e1bce085e3238418ef4e833e4b935a7b59f9756facd4a6bd3e9c6c3eb687"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c0f08f603295e829ec67ec84c9387d2cc0c4b71511a30008317556b8e49e6d5d"},"taxa":[{"id":"CWE-444","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"1498b18f87cdc919dc142ebc4df370d8cf0f94a527620e2a6aabf03f2968496a"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"05d93385ca900d9356f0a9976cf405d3ec2909163ec7e5b3f3db89af3a145ee3"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f9f20e4566f952a9f7685ae67d8b485659cf5e7919d91911153e6b1a52ed8c1b"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"d47a939ef079bc344ab548817bda747abbbbcbff71607c31983e72771aea6b87"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"95e8744c472cf38701ab60b5e1f5e9bc140c8d128e169ad42b75fcfc96f39b8e"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"684e54e9431479762bc152f1ed751c25007ae022390aaedc04386dbc16753d29"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D29","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"cac8f11e18d33b43f6d5ede977bd2d83cc0a970dd4b49e3f62d3be213b38bee8"},"taxa":[{"id":"CWE-78","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D31","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"f9deb0b3e9568df1171bacf908174d514cb7e71041f1c1975b38340d1bde8fc0"}},{"ruleId":"D31","level":"error","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"c2e1c33b058c005e6250f1c0f084e946c06ff1870f1bdd4ba3f17649dd503141"}},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"456d2c3f511799653c765ed1632fec68481d07b1aa9db4d76a6f5dab8c714fd8"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}},{"id":"CWE-353","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"55767f2c444a26685885e6e4aac2d13c70d145e3d8f738cea4dd407e7cab7e18"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D31","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"bca0d3f31d7b039b28ed6b824a6e3dbea1044b234ac21cf260ae5297ce2c889c"},"taxa":[{"id":"CWE-1357","toolComponent":{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d"}}]},{"ruleId":"D31","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ccc0cc717a360059224d480b2bc872b7f88a881960a07fa78798e15be3c752b9"}},{"ruleId":"D34","level":"note","message":{"text":"Dormant codebase: 67 of 86 significant files have no living knowledge \u2014 the codebase as a whole is dormant, not 67 separate risks. Counted over 86 of the 133 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. Re-engage owners or document before change."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"4c69f1e54b7dd6fe9029dd02df6ba8f8145b789f2f18dbdaa086c40ded49dba6"}},{"ruleId":"D34","level":"note","message":{"text":"Most significant orphaned file: One of the orphaned files carrying the most lost knowledge \u2014 ranked by size weighted by the file\u0027s role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/monitor/classify/category.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3920a48e1b2ea7deaf820dae7183d66e9c8d24211f78dedabda4bf55fc127f3"}},{"ruleId":"D34","level":"note","message":{"text":"Most significant orphaned file: One of the orphaned files carrying the most lost knowledge \u2014 ranked by size weighted by the file\u0027s role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/llm_judge/common.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"81467e00200098fbe3c86af3448caf489abb1ae95bf3ad1609dcfb4fe67e7059"}},{"ruleId":"D34","level":"note","message":{"text":"Most significant orphaned file: One of the orphaned files carrying the most lost knowledge \u2014 ranked by size weighted by the file\u0027s role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gradio_block_arena_vision_anony.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"26c6b5f8da8d2f97d825257795952ccaa730b8c0879c1a1e78ddeace4f2f7b93"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: model_chatglm.py \u2194 inference.py: \u0060fastchat/model/model_chatglm.py\u0060 and \u0060fastchat/serve/inference.py\u0060 change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are \u00603cbe2a55\u0060 fix bugs: remove eos token when judge_sent_end open and sentence not \u2026; \u00605ebce039\u0060 Misc maintenance updates  (#1830); \u00609d857345\u0060 Fix ChatGLM prompt template (#1786) (at that commit the file was still \u0060fastchat/model/chatglm_model.py\u0060) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_chatglm.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"ddac5308ae27169711ab022afd65b5245e3a504b9d6d5d604aaf9356de2438b8"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: huggingface_api.py \u2194 inference.py: \u0060fastchat/serve/huggingface_api.py\u0060 and \u0060fastchat/serve/inference.py\u0060 change together 57% of the time (12 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module \u2014 a sibling reference still needs an import \u2014 so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are \u00609b128520\u0060 [Minor] code style improvements (#2131); \u0060edef7de8\u0060 Improve docs (#1738); \u006055051ad0\u0060 Support specifying \u0060revision\u0060 in \u0060load_model\u0060 (#1699) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/huggingface_api.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"addd06abbbc7b769bac1433220964bc5568482804b0c9ab6054edee96d53a9d8"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: api_provider.py \u2194 gradio_block_arena_anony.py: \u0060fastchat/serve/api_provider.py\u0060 and \u0060fastchat/serve/gradio_block_arena_anony.py\u0060 change together 52% of the time (15 of the 29 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module \u2014 a sibling reference still needs an import \u2014 so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are \u0060d6e34ff7\u0060 Update vision arena docs and fix system for test (#3337); \u0060a62ea52d\u0060 Add CSAM and NSFW image moderation and fix Reka logging (#3327); \u00601f60e7fe\u0060 code update (#3286) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/api_provider.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"eb7f425c6a5842f1dd4de8a95ab6c72c5cfe9fca1dcbec975896de747c683bd3"}},{"ruleId":"D35","level":"warning","message":{"text":"Change coupling: model_chatglm.py \u2194 model_worker.py: \u0060fastchat/model/model_chatglm.py\u0060 and \u0060fastchat/serve/model_worker.py\u0060 change together 50% of the time (6 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well \u2014 a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency \u2014 the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE \u2014 the registration is the link, and it is meant not to be an import \u2014 and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are \u00605ebce039\u0060 Misc maintenance updates  (#1830); \u0060edef7de8\u0060 Improve docs (#1738) (at that commit the file was still \u0060fastchat/model/chatglm_model.py\u0060); \u0060e276c2f6\u0060 Adjust the limit for conversations (#1278) (at that commit the file was still \u0060fastchat/model/chatglm_model.py\u0060) \u2014 run \u0060git show\u0060 on any of them."},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/model/model_chatglm.py"},"region":{"startLine":1}}}],"partialFingerprints":{"codehealthFindingId/v1":"b3c0c2e0913ca2d7138ce26f3f824ca9aa89d6d99f7f18f5144b0df491b925a8"}},{"ruleId":"D36","level":"warning","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"9658270ba49f37ed04e99ab1263b6393cd42aed8bdfb7aafd9fa1070f5491895"}},{"ruleId":"D36","level":"note","message":{"text":"A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."},"partialFingerprints":{"codehealthFindingId/v1":"ace515990e7ee0f17b5c17e44dd168a5bdecf90804a3a3dd845cf05540978013"}},{"ruleId":"M2","level":"note","message":{"text":"No ADRs: No Architecture Decision Records found \u2014 no conventional ADR directory, no numbered \u0060NNNN-title\u0060 documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"670b3d6e36a756d63097d0dfbf90afd5fc761308800b9354894a07c3f4e4aa14"}},{"ruleId":"M3","level":"note","message":{"text":"No src/ separation: Production code isn\u0027t grouped under a src/ folder \u2014 it\u0027s spread across several top-level directories, so there\u0027s no one place that says \u0027this is the product\u0027."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"fdf7f5b24e313364d10170a5c2542959902fe0d26ed70edef3eaa10ec5bcdb1d"}},{"ruleId":"P3","level":"note","message":{"text":"No SAST: No static application security testing detected. For this repository\u0027s stack, add bandit, \u0060semgrep --config=p/python\u0060, or CodeQL\u0027s python pack as a CI step. What was searched, so you can tell an absence from a miss: the 674 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge\u0027s web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen \u2014 if that is your case the row is wrong, and saying so is more useful than adding a second scanner."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"6e54424179c892f03ef2fd003130ac4bd43f39bbf3b1ca0a0143e25acb80ec87"}},{"ruleId":"P4","level":"note","message":{"text":"No rollback/health safety: Deployment is orchestrated by compose, but no service declares a \u0060healthcheck:\u0060 and nothing pins a previous image to fall back to \u2014 the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse."},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"db6bab8a28a2145f47e5a4e6683cda39d2ba0296c723238e8057da979ae1c706"}},{"ruleId":"P6","level":"note","message":{"text":"No changelog: No CHANGELOG/HISTORY/RELEASES file \u2014 what shipped when isn\u0027t easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)"},"locations":[],"partialFingerprints":{"codehealthFindingId/v1":"dda5aa5aed8cbb292c3ef2b733bc138f614293ae6426c85e98bf31ef330d9415"}},{"ruleId":"S1","level":"note","message":{"text":"No security response headers detected: No Content-Security-Policy / X-Frame-Options / X-Content-Type-Options configuration found \u2014 defense in depth, even when a reverse proxy could set them. This is reported because \u0060nginx.conf\u0060 is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (\u22122.0 on this card.)"},"locations":[{"physicalLocation":{"artifactLocation":{"uri":"fastchat/serve/gateway/nginx.conf"},"region":{"startLine":72}}}],"partialFingerprints":{"codehealthFindingId/v1":"ed2d01a740d7fbb2951c1e5be6c87ce6d11791469d551f469601e4fcaf2f2b1b"}}],"taxonomies":[{"name":"CWE","guid":"c3a2b1d0-7f3e-4b2a-9c1d-5e6f7a8b9c0d","organization":"MITRE","informationUri":"https://cwe.mitre.org/","isComprehensive":false,"shortDescription":{"text":"The MITRE Common Weakness Enumeration (CWE)."},"taxa":[{"id":"CWE-1032","guid":"5f21e517-68aa-a650-9a25-5771ef024637","name":"OWASP Top Ten \u2014 Security Misconfiguration category","shortDescription":{"text":"OWASP Top Ten \u2014 Security Misconfiguration category"},"helpUri":"https://cwe.mitre.org/data/definitions/1032.html"},{"id":"CWE-1104","guid":"4c918cb5-b2a6-6c55-9963-a44ee464305e","name":"CWE-1104","shortDescription":{"text":"CWE-1104"},"helpUri":"https://cwe.mitre.org/data/definitions/1104.html"},{"id":"CWE-1329","guid":"f70f1c3f-4ccf-cb5e-bdd3-03ba4868d36d","name":"CWE-1329","shortDescription":{"text":"CWE-1329"},"helpUri":"https://cwe.mitre.org/data/definitions/1329.html"},{"id":"CWE-1357","guid":"e4d2e772-757e-0a5c-bd7d-77052949d866","name":"Reliance on Insufficiently Trustworthy Component","shortDescription":{"text":"Reliance on Insufficiently Trustworthy Component"},"helpUri":"https://cwe.mitre.org/data/definitions/1357.html"},{"id":"CWE-16","guid":"659db3ea-affc-8453-8add-c1218fbfcb92","name":"Configuration","shortDescription":{"text":"Configuration"},"helpUri":"https://cwe.mitre.org/data/definitions/16.html"},{"id":"CWE-259","guid":"ae9ad959-fbb6-9d5e-892d-3dca66da0b69","name":"Use of Hard-coded Password","shortDescription":{"text":"Use of Hard-coded Password"},"helpUri":"https://cwe.mitre.org/data/definitions/259.html"},{"id":"CWE-327","guid":"e51910ff-67b5-3c51-aa3d-92837d9eab90","name":"CWE-327","shortDescription":{"text":"CWE-327"},"helpUri":"https://cwe.mitre.org/data/definitions/327.html"},{"id":"CWE-353","guid":"09d7e902-d4ee-f05d-ae6c-0a1554d0c18f","name":"CWE-353","shortDescription":{"text":"CWE-353"},"helpUri":"https://cwe.mitre.org/data/definitions/353.html"},{"id":"CWE-444","guid":"8989da48-caaf-a955-b9ef-53767db527d8","name":"CWE-444","shortDescription":{"text":"CWE-444"},"helpUri":"https://cwe.mitre.org/data/definitions/444.html"},{"id":"CWE-494","guid":"b8a65e0d-e459-4a55-a931-fc1136482375","name":"Download of Code Without Integrity Check","shortDescription":{"text":"Download of Code Without Integrity Check"},"helpUri":"https://cwe.mitre.org/data/definitions/494.html"},{"id":"CWE-502","guid":"f7d3b296-aac0-5c5a-b706-e07faba26c36","name":"CWE-502","shortDescription":{"text":"CWE-502"},"helpUri":"https://cwe.mitre.org/data/definitions/502.html"},{"id":"CWE-732","guid":"1da27e8f-b330-7650-ab63-bd61953eae5d","name":"Incorrect Permission Assignment for Critical Resource","shortDescription":{"text":"Incorrect Permission Assignment for Critical Resource"},"helpUri":"https://cwe.mitre.org/data/definitions/732.html"},{"id":"CWE-77","guid":"332c8ade-6612-9f56-a06b-d8d90b1a8750","name":"Command Injection","shortDescription":{"text":"Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/77.html"},{"id":"CWE-78","guid":"2e31ceaf-c7ae-2e5e-9661-cfb1362789cf","name":"OS Command Injection","shortDescription":{"text":"OS Command Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/78.html"},{"id":"CWE-79","guid":"fd45580b-e8c4-fc5e-8c2f-aa8fab0b4dbf","name":"Cross-site Scripting (XSS)","shortDescription":{"text":"Cross-site Scripting (XSS)"},"helpUri":"https://cwe.mitre.org/data/definitions/79.html"},{"id":"CWE-798","guid":"5e8f057d-fee3-995a-a0cb-9fc5b0d174d1","name":"Use of Hard-coded Credentials","shortDescription":{"text":"Use of Hard-coded Credentials"},"helpUri":"https://cwe.mitre.org/data/definitions/798.html"},{"id":"CWE-829","guid":"13c33925-97fb-5a5e-b40c-56d328b8a4d7","name":"CWE-829","shortDescription":{"text":"CWE-829"},"helpUri":"https://cwe.mitre.org/data/definitions/829.html"},{"id":"CWE-89","guid":"6d08fdad-37eb-c150-bbf0-d7d946863407","name":"SQL Injection","shortDescription":{"text":"SQL Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/89.html"},{"id":"CWE-94","guid":"75e7f50c-6c2f-dd52-bf40-bf6c52b861fd","name":"Code Injection","shortDescription":{"text":"Code Injection"},"helpUri":"https://cwe.mitre.org/data/definitions/94.html"}]}],"properties":{"codehealthPublication":{"public":true,"notice":"This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings \u2014 which rule fired, in which file, on which line, and how to fix it \u2014 are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.","securityFindingsRedacted":29,"secretScannerRunsExcluded":0}},"redactionTokens":["A security finding was recorded here. Its details are withheld on the public artifact \u2014 ask the repository owner for the full report."]}]}