{ "permissions": { "allow": [ "Bash(mvn -q test-compile)", "Bash(mvn -B clean test jacoco:report -DskipTests=false)", "Bash(find target/site/jacoco -name \"index.html\" -exec cat {})", "Bash(mvn jacoco:report)", "mcp__serena__get_current_config", "mcp__serena__get_symbols_overview", "mcp__serena__activate_project", "mcp__serena__check_onboarding_performed", "Bash(mvn -B test -Dtest=ActivityServiceTest,ActivityServiceCacheTest,ActivityServiceCoverageTest)", "Bash(mvn -B test -Dtest=*ActivityController*)", "Bash(mvn -B test -Dtest=CacheConfigTest,CacheConfigIntegrationTest)", "Bash(mvn clean test -B -q 2>&1 | tail -100)", "Bash(mvn dependency:tree -B -q 2>&1 | grep -E \"^\\\\[INFO\\\\] \\(com\\\\.mosquito|org\\\\.springframework|redis|flyway\\)\" | head -50)", "Bash(mvn verify -B -q 2>&1 | grep -A 5 \"BUILD SUCCESS\\\\|BUILD FAILURE\\\\|Tests run:\")", "Bash(mvn clean test -B -q 2>&1 | tail -20)", "Bash(mvn clean test -B -q 2>&1 | tail -30)", "Bash(mvn test -B -q 2>&1 | grep -E \"Tests run:|BUILD SUCCESS|BUILD FAILURE\" | tail -5)", "Bash(mvn verify -B -DskipTests=false 2>&1 | grep -A 10 \"BUILD SUCCESS\\\\|BUILD FAILURE\" | tail -15)", "Bash(find target -name \"index.html\" -path \"*/jacoco/*\" 2>/dev/null | head -1)", "Bash(mvn dependency:tree -B -q 2>&1 | grep -E \"spring-boot-starter-\\(amqp|data-jpa|data-redis\\)\" | head -10)", "Bash(if [ -f target/site/jacoco/jacoco.xml ]; then grep -A 2 'type=\"INSTRUCTION\"' target/site/jacoco/jacoco.xml | head -10; else echo \"XML报告不存在\"; fi)", "Bash(mvn test -B -q 2>&1 | grep \"Tests run:\" | tail -1)", "Bash(python3 << 'EOF'\nimport xml.etree.ElementTree as ET\nimport sys\n\ntry:\n tree = ET.parse\\('target/site/jacoco/jacoco.xml'\\)\n root = tree.getroot\\(\\)\n \n # 获取总体覆盖率\n for counter in root.findall\\('.//counter[@type=\"INSTRUCTION\"]'\\):\n missed = int\\(counter.get\\('missed', 0\\)\\)\n covered = int\\(counter.get\\('covered', 0\\)\\)\n total = missed + covered\n if total > 0:\n ratio = covered / total * 100\n print\\(f\"指令覆盖率: {ratio:.2f}% \\({covered}/{total}\\)\"\\)\n break\n \n for counter in root.findall\\('.//counter[@type=\"BRANCH\"]'\\):\n missed = int\\(counter.get\\('missed', 0\\)\\)\n covered = int\\(counter.get\\('covered', 0\\)\\)\n total = missed + covered\n if total > 0:\n ratio = covered / total * 100\n print\\(f\"分支覆盖率: {ratio:.2f}% \\({covered}/{total}\\)\"\\)\n break\n \n for counter in root.findall\\('.//counter[@type=\"LINE\"]'\\):\n missed = int\\(counter.get\\('missed', 0\\)\\)\n covered = int\\(counter.get\\('covered', 0\\)\\)\n total = missed + covered\n if total > 0:\n ratio = covered / total * 100\n print\\(f\"行覆盖率: {ratio:.2f}% \\({covered}/{total}\\)\"\\)\n break\n \nexcept Exception as e:\n print\\(f\"解析失败: {e}\"\\)\n sys.exit\\(1\\)\nEOF)", "Bash(mvn test -B -q 2>&1 | grep -E \"Tests run:\" | tail -1)", "Bash(python3 << 'EOF'\nimport xml.etree.ElementTree as ET\n\ntree = ET.parse\\('target/site/jacoco/jacoco.xml'\\)\nroot = tree.getroot\\(\\)\n\n# 获取包级别的覆盖率\nfor counter in root.findall\\('./counter[@type=\"INSTRUCTION\"]'\\):\n missed = int\\(counter.get\\('missed', 0\\)\\)\n covered = int\\(counter.get\\('covered', 0\\)\\)\n total = missed + covered\n if total > 0:\n ratio = covered / total * 100\n print\\(f\"总体指令覆盖率: {ratio:.2f}% \\({covered}/{total}\\)\"\\)\n\nfor counter in root.findall\\('./counter[@type=\"BRANCH\"]'\\):\n missed = int\\(counter.get\\('missed', 0\\)\\)\n covered = int\\(counter.get\\('covered', 0\\)\\)\n total = missed + covered\n if total > 0:\n ratio = covered / total * 100\n print\\(f\"总体分支覆盖率: {ratio:.2f}% \\({covered}/{total}\\)\"\\)\n\nfor counter in root.findall\\('./counter[@type=\"LINE\"]'\\):\n missed = int\\(counter.get\\('missed', 0\\)\\)\n covered = int\\(counter.get\\('covered', 0\\)\\)\n total = missed + covered\n if total > 0:\n ratio = covered / total * 100\n print\\(f\"总体行覆盖率: {ratio:.2f}% \\({covered}/{total}\\)\"\\)\nEOF)", "Bash(mvn dependency:tree -B -q 2>&1 | grep -E \"spring-boot-starter\" | grep -v \"test\" | sort -u)", "Bash(mvn dependency:analyze -B -q 2>&1 | grep -A 20 \"Used undeclared dependencies\\\\|Unused declared dependencies\")", "Bash(grep -r \"import.*amqp\" src/main/java/ 2>/dev/null | wc -l)", "Bash(git add PROJECT_STATUS_REPORT.md && git status --short)", "Bash(python3 << 'EOF'\nimport xml.etree.ElementTree as ET\n\ntree = ET.parse\\('target/site/jacoco/jacoco.xml'\\)\nroot = tree.getroot\\(\\)\n\n# 找出分支覆盖率最低的类\nclasses_coverage = []\n\nfor package in root.findall\\('.//package'\\):\n package_name = package.get\\('name'\\)\n for cls in package.findall\\('.//class'\\):\n class_name = cls.get\\('name'\\)\n source_file = cls.get\\('sourcefilename'\\)\n \n branch_counter = None\n for counter in cls.findall\\('./counter[@type=\"BRANCH\"]'\\):\n branch_counter = counter\n break\n \n if branch_counter is not None:\n missed = int\\(branch_counter.get\\('missed', 0\\)\\)\n covered = int\\(branch_counter.get\\('covered', 0\\)\\)\n total = missed + covered\n if total > 0:\n ratio = covered / total * 100\n classes_coverage.append\\({\n 'class': class_name.replace\\('/', '.'\\),\n 'file': source_file,\n 'covered': covered,\n 'missed': missed,\n 'total': total,\n 'ratio': ratio\n }\\)\n\n# 按覆盖率排序,显示最低的10个\nclasses_coverage.sort\\(key=lambda x: x['ratio']\\)\nprint\\(\"分支覆盖率最低的10个类:\\\\n\"\\)\nfor i, cls in enumerate\\(classes_coverage[:10], 1\\):\n print\\(f\"{i}. {cls['file']}\"\\)\n print\\(f\" 覆盖率: {cls['ratio']:.1f}% \\({cls['covered']}/{cls['total']}\\)\"\\)\n print\\(\\)\nEOF)", "Bash(git add -A && git status --short | head -30)" ] } }