Gitlab Custom rules for Code Quality

Problem to solve

Custom code quality rules in gitlab:

  • How to add customizable rules for code quality for Custom-written quality ?
  • Wanted to create custome rules for [ Null point exception, Custom memory leak detection, Janky frame identification]

Steps to reproduce

I have tried creating .codeclimate.yml for adding custom rules and used there pre defined plugins
which help to add rules but it was not enough rules

Configuration

CI/CD configuration from .gitlab-ci.yml

stages:
  - build
  - test


include:
   - template: Code-Quality.gitlab-ci.yml


variables:
  VERSION: ""
  deploy: ""
  SAST_RULESET_GIT_REFERENCE: "gitlab.com/group_name/project_name"
  CS_DEFAULT_BRANCH_IMAGE: $CI_REGISTRY_IMAGE/$CI_DEFAULT_BRANCH:$CI_COMMIT_SHA
  DOCKER_DRIVER: overlay2
  CONTAINER_REGISTRY_IMAGE: $CI_REGISTRY_IMAGE
  DOCKER_TLS_CERTDIR: ""  # https://gitlab.com/gitlab-org/gitlab-runner/issues/4501

code_quality:
  stage: test
  tags:
    - docker-testing-run
  artifacts:
    name: codequality
    paths: [gl-code-quality-report.json] 
    reports:
      codequality: gl-code-quality-report.json
    expire_in: never 
  rules:
    - if: $CI_PIPELINE_SOURCE == "push"


.codeclimate.yml

version: "2"        
checks:
  argument-count:
    config:
      threshold: 10
  nested-control-flow:
    config:
      threshold: 4
  complex-logic:
      config:
      threshold: 4
  file-lines:
    enabled: false
    config:
      threshold: 4
  method-complexity:
    enabled: false
    config:
      threshold: 4
  method-count:
    enabled: false
    config:
      threshold: 4
  method-lines:
    enabled: false
    config:
      threshold: 4

Versions

Thanks for taking the time to be thorough in your request, it really helps! :blush:

I am trying the same thing but I am getting error “Adding custom plugin in codeclimate yml it does not recognize the engine”