From ff91a5152b168de80e3ccab5d157a66fb8a221ea Mon Sep 17 00:00:00 2001 From: "Juraj K." <140317448+mostypc123@users.noreply.github.com> Date: Sun, 1 Dec 2024 20:10:15 +0100 Subject: [PATCH] Delete .github/workflows/codeql.yml --- .github/workflows/codeql.yml | 98 ------------------------------------ 1 file changed, 98 deletions(-) delete mode 100644 .github/workflows/codeql.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 8bbd8a2..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Code Quality Checks - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - code-quality-report: - runs-on: ubuntu-latest - permissions: - issues: write - contents: read - steps: - - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - - - name: Install dependencies - run: | - pip install pyflakes - pip install stdlib-list - pip install pylint - pip install nltk - - - name: Analyze Code Quality - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - # Dead Code Detection - dead_code_report=$(pyflakes . | grep -E "imported but unused|defined but not used" || true) - - # Code Duplication Detection - duplication_report=$(pylint --disable=all --enable=duplicate-code . || true) - - # Comment Quality Check - comment_report=$(python3 -c ' -import re -import os - -def analyze_comments(file_path): - issues = [] - with open(file_path, "r") as f: - for line_num, line in enumerate(f, 1): - comment_match = re.search(r"#\s*(.+)", line) - if comment_match: - comment = comment_match.group(1) - - if len(comment) < 3: - issues.append(f"{file_path}:{line_num} - Comment too short") - - vague_words = ["thing", "stuff", "do", "make", "handle"] - for word in vague_words: - if word in comment.lower(): - issues.append(f"{file_path}:{line_num} - Vague comment") - - return issues - -def main(): - total_issues = [] - for root, dirs, files in os.walk("."): - for file in files: - if file.endswith(".py"): - file_path = os.path.join(root, file) - file_issues = analyze_comments(file_path) - total_issues.extend(file_issues) - - print("\n".join(total_issues)) - -main()' || true) - - # Prepare the issue body - issue_body="" - - if [ -n "$dead_code_report" ]; then - issue_body+="## 💀 Dead Code Detection\n\`\`\`\n$dead_code_report\n\`\`\`\n\n" - fi - - if [ -n "$duplication_report" ]; then - issue_body+="## 📋 Code Duplication\n\`\`\`\n$duplication_report\n\`\`\`\n\n" - fi - - if [ -n "$comment_report" ]; then - issue_body+="## 💬 Comment Quality Issues\n\`\`\`\n$comment_report\n\`\`\`\n\n" - fi - - if [ -n "$issue_body" ]; then - echo "$issue_body" > code_quality_report.md - - gh issue create \ - --title "Code Quality Report - $(date +'%Y-%m-%d')" \ - --body-file code_quality_report.md \ - --label "code-quality" - fi