From 8e98e48aa280eb735c9c174ed39d71c8e363b762 Mon Sep 17 00:00:00 2001 From: steven Date: Wed, 4 Mar 2026 20:07:36 +0800 Subject: [PATCH 1/2] Add code quality badges and Code Climate configuration - Add CodeFactor badge for automated code quality analysis - Add Code Climate badge for maintainability tracking - Create .codeclimate.yml configuration file with: - Complexity and quality checks - RuboCop, Brakeman, and Bundler Audit plugins - Exclude patterns for config, db, spec, and vendor To activate: 1. CodeFactor: Visit https://www.codefactor.io and add the repository 2. Code Climate: Visit https://codeclimate.com and add the repository, then replace YOUR_BADGE_ID in README with the actual badge ID Co-Authored-By: Claude Opus 4.6 --- .codeclimate.yml | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 57 insertions(+) create mode 100644 .codeclimate.yml diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 0000000..8511215 --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,55 @@ +version: "2" +checks: + argument-count: + enabled: true + config: + threshold: 4 + complex-logic: + enabled: true + config: + threshold: 4 + file-lines: + enabled: true + config: + threshold: 250 + method-complexity: + enabled: true + config: + threshold: 5 + method-count: + enabled: true + config: + threshold: 20 + method-lines: + enabled: true + config: + threshold: 25 + nested-control-flow: + enabled: true + config: + threshold: 4 + return-statements: + enabled: true + config: + threshold: 4 + similar-code: + enabled: true + identical-code: + enabled: true + +plugins: + rubocop: + enabled: true + channel: rubocop-1-latest + brakeman: + enabled: true + bundler-audit: + enabled: true + +exclude_patterns: + - "config/" + - "db/" + - "spec/" + - "test/" + - "vendor/" + - "node_modules/" diff --git a/README.md b/README.md index 5304cb7..f112989 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ![CI Status](https://github.com/springwq/creator-pulse/actions/workflows/ci.yml/badge.svg) ![Code Coverage](https://codecov.io/gh/springwq/creator-pulse/branch/main/graph/badge.svg) +![CodeFactor](https://www.codefactor.io/repository/github/springwq/creator-pulse/badge) +![Code Climate](https://api.codeclimate.com/v1/badges/YOUR_BADGE_ID/maintainability) ![Security](https://img.shields.io/badge/Security-Brakeman%20%7C%20Bundler%20Audit-brightgreen?logo=security) ![Ruby Version](https://img.shields.io/badge/Ruby-4.0-red?logo=ruby&logoColor=white) ![Rails Version](https://img.shields.io/badge/Rails-8.1-red?logo=rubyonrails&logoColor=white) From e2ba77640db7b3010052d23cca19e6e83f24e9f0 Mon Sep 17 00:00:00 2001 From: steven Date: Wed, 4 Mar 2026 20:20:12 +0800 Subject: [PATCH 2/2] Remove Code Climate and configure CodeFactor - Remove Code Climate badge from README - Delete .codeclimate.yml configuration file - Add .codefactor configuration file with: - Exclude patterns for spec, test, config, db, vendor - RuboCop integration enabled - Use existing .rubocop.yml configuration CodeFactor will automatically analyze the repository and provide code quality scores based on RuboCop rules. Co-Authored-By: Claude Opus 4.6 --- .codeclimate.yml | 55 ------------------------------------------------ .codefactor | 19 +++++++++++++++++ README.md | 1 - 3 files changed, 19 insertions(+), 56 deletions(-) delete mode 100644 .codeclimate.yml create mode 100644 .codefactor diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 8511215..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: "2" -checks: - argument-count: - enabled: true - config: - threshold: 4 - complex-logic: - enabled: true - config: - threshold: 4 - file-lines: - enabled: true - config: - threshold: 250 - method-complexity: - enabled: true - config: - threshold: 5 - method-count: - enabled: true - config: - threshold: 20 - method-lines: - enabled: true - config: - threshold: 25 - nested-control-flow: - enabled: true - config: - threshold: 4 - return-statements: - enabled: true - config: - threshold: 4 - similar-code: - enabled: true - identical-code: - enabled: true - -plugins: - rubocop: - enabled: true - channel: rubocop-1-latest - brakeman: - enabled: true - bundler-audit: - enabled: true - -exclude_patterns: - - "config/" - - "db/" - - "spec/" - - "test/" - - "vendor/" - - "node_modules/" diff --git a/.codefactor b/.codefactor new file mode 100644 index 0000000..3873169 --- /dev/null +++ b/.codefactor @@ -0,0 +1,19 @@ +# CodeFactor configuration +# https://support.codefactor.io/i14-glossary + +exclude: + - spec/** + - test/** + - config/** + - db/** + - vendor/** + - node_modules/** + - coverage/** + - tmp/** + - log/** + +languages: + Ruby: + rubocop: + enabled: true + config: .rubocop.yml diff --git a/README.md b/README.md index f112989..ce29771 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,6 @@ ![CI Status](https://github.com/springwq/creator-pulse/actions/workflows/ci.yml/badge.svg) ![Code Coverage](https://codecov.io/gh/springwq/creator-pulse/branch/main/graph/badge.svg) ![CodeFactor](https://www.codefactor.io/repository/github/springwq/creator-pulse/badge) -![Code Climate](https://api.codeclimate.com/v1/badges/YOUR_BADGE_ID/maintainability) ![Security](https://img.shields.io/badge/Security-Brakeman%20%7C%20Bundler%20Audit-brightgreen?logo=security) ![Ruby Version](https://img.shields.io/badge/Ruby-4.0-red?logo=ruby&logoColor=white) ![Rails Version](https://img.shields.io/badge/Rails-8.1-red?logo=rubyonrails&logoColor=white)