Code Climate CLI

Overview

Code Climate CLI

Code Climate CircleCI

Overview

codeclimate is a command line interface for the Code Climate analysis platform. It allows you to run Code Climate engines on your local machine inside of Docker containers.

Prerequisites

The Code Climate CLI is distributed and run as a Docker image. The engines that perform the actual analyses are also Docker images. To support this, you must have Docker installed and running locally. We also require that the Docker daemon supports connections on the default Unix socket /var/run/docker.sock.

On macOS, we recommend using Docker for Mac.

Installation

macOS

brew tap codeclimate/formulae
brew install codeclimate

To update the brew package, use brew update first:

brew update
brew upgrade codeclimate

Anywhere

curl -L https://github.com/codeclimate/codeclimate/archive/master.tar.gz | tar xvz
cd codeclimate-* && sudo make install

To upgrade to a newer version, just run those steps again.

Manual Docker invocation

The above packages pull the docker image and install a shell script wrapper. In some cases you may want to run the docker image directly.

To pull the docker image:

docker pull codeclimate/codeclimate

To invoke the CLI via Docker:

docker run \
  --interactive --tty --rm \
  --env CODECLIMATE_CODE="$PWD" \
  --volume "$PWD":/code \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  --volume /tmp/cc:/tmp/cc \
  codeclimate/codeclimate help

Project setup

Configuration

No explicit configuration is needed: by default codeclimate analyze will evaluate supported source files in your repository using our maintainability checks. To change default configuration to customize how the maintainability checks are evaluated, or to turn on open source plugins, see our documentation on advanced configuration.

Plugin installation

Plugins, or "engines", are the docker images that run analysis tools. We support many different plugins, and will only install the ones necessary to run analysis. As part of setting up your project, we recommend running codeclimate engines:install from within your repository before running codeclimate analyze, and after adding any new plugins to your configuration file.

Running analysis

Once you've installed plugins and made any necessary changes to your configuration, run codeclimate analyze to run analysis and see a report on any issues in your repository.

Commands

A list of available commands is accessible by running codeclimate or codeclimate help.

$ codeclimate help

Available commands:
    analyze [-f format] [-e engine[:channel]] [--dev] [path]
    console
    engines:install
    engines:list
    help [command]
    prepare [--allow-internal-ips]
    validate-config
    version

The following is a brief explanation of each available command.

  • analyze Analyze all relevant files in the current working directory. All engines that are enabled in your .codeclimate.yml file will run, one after another. The -f (or format) argument allows you to set the output format of the analysis (using json, text, or html). The --dev flag lets you run engines not known to the CLI, for example if you're an engine author developing your own, unreleased image.

    You can optionally provide a specific path to analyze. If not provided, the CLI will analyze your entire repository, except for your configured exclude_paths. When you do provide an explicit path to analyze, your configured exclude_paths are ignored, and normally excluded files will be analyzed.

    You can also pipe in source in combination with a path to analyze code that is not yet written to disk. This is useful when you want to check if your source code style matches the project's. This is also a good way to implement integration with an editor to check style on the fly.

  • console start an interactive session providing access to the classes within the CLI. Useful for engine developers and maintainers.

  • engines:install Compares the list of engines in your .codeclimate.yml file to those that are currently installed, then installs any missing engines and checks for new images available for existing engines.

  • engines:list Lists all available engines in the Code Climate Docker Hub .

  • help Displays a list of commands that can be passed to the Code Climate CLI.

  • validate-config Validates the .codeclimate.yml file in the current working directory.

  • version Displays the current version of the Code Climate CLI.

Environment Variables

  • To run codeclimate in debug mode:

    CODECLIMATE_DEBUG=1 codeclimate analyze
    

    Prints additional information about the analysis steps, including any stderr produced by engines.

  • To increase the amount of time each engine container may run (default 15 min):

    # 30 minutes
    CONTAINER_TIMEOUT_SECONDS=1800 codeclimate analyze
    
  • You can also configure the default alotted memory with which each engine runs (default is 1,024,000,000 bytes):

    # 2,000,000,000 bytes
    ENGINE_MEMORY_LIMIT_BYTES=2000000000 codeclimate analyze
    

Copyright

See LICENSE

Issues
  • EngineFailure error on fresh install

    EngineFailure error on fresh install

    Hey, I just created a new codeclimate.yml using codeclimate init, validated the config and tried to run codeclimate analyze. I got the following error

    error: (CC::Analyzer::Engine::EngineFailure) engine rubocop failed with status 1 and stderr "/usr/lib/ruby/gems/2.2.0/gems/rubocop-0.31.0/lib/rubocop/target_finder.rb:121:ininitialize': Permission denied @ rb_sysopen - /code/dd (Errno::EACCES)\n\tfrom /usr/lib/ruby/gems/2.2.0/gems/rubocop-0.31.0/lib/rubocop/target_finder.rb:121:in open'\n\tfrom /usr/lib/ruby/gems/2.2.0/gems/rubocop-0.31.0/lib/rubocop/target_finder.rb:121:inruby_executable?'\n\tfrom /usr/lib/ruby/gems/2.2.0/gems/rubocop-0.31.0/lib/rubocop/target_finder.rb:78:in to_inspect?'\n\tfrom /usr/lib/ruby/gems/2.2.0/gems/rubocop-0.31.0/lib/rubocop/target_finder.rb:65:inblock in target_files_in_dir'\n\tfrom /usr/lib/ruby/gems/2.2.0/gems/rubocop-0.31.0/lib/rubocop/target_finder.rb:64:in select'\n\tfrom /usr/lib/ruby/gems/2.2.0/gems/rubocop-0.31.0/lib/rubocop/target_finder.rb:64:intarget_files_in_dir'\n\tfrom /usr/lib/ruby/gems/2.2.0/gems/rubocop-0.31.0/lib/rubocop/target_finder.rb:31:in find'\n\tfrom /usr/lib/ruby/gems/2.2.0/gems/rubocop-0.31.0/lib/rubocop/runner.rb:41:infind_target_files'\n\tfrom /usr/src/app/lib/cc/engine/rubocop.rb:18:in block in run'\n\tfrom /usr/src/app/lib/cc/engine/rubocop.rb:16:inchdir'\n\tfrom /usr/src/app/lib/cc/engine/rubocop.rb:16:in run'\n\tfrom /usr/src/app/bin/codeclimate-rubocop:6:in

    '\n"`

    The contents of my yml are:

    engines:
      rubocop:
        enabled: true
    ratings:
      paths:
      - "**.rb"
    exclude_paths:
    - config/**/*
    - db/**/*
    - test/**/*
    - vendor/**/*
    

    Any thoughts?

    opened by alexpjohnson 35
  • Engine attempting to access excluded files

    Engine attempting to access excluded files

    I'm on codeclimate 0.2.8 running the following config:

    
    ---
    engines:
      eslint:
        enabled: true
      csslint:
        enabled: false
      fixme:
        enabled: true
      watson:
        enabled: true
    ratings:
      paths:
      - "app/**"
    exclude_paths:
    - bower_components/**/*
    - dist/**/*
    - node_modules/**/*
    - tests/**/*
    - tmp/**/*
    - vendor/**/*
    

    I get the following error for codeclimate analyze:

    Starting analysis
    Running eslint: Done!
    error: (CC::Analyzer::Engine::EngineFailure) engine eslint failed with status 1 and stderr
    /usr/src/app/node_modules/glob/sync.js:321
            throw er
                  ^
    Error: EACCES, permission denied '/code/tmp/asset_rewrite-cache_path-RFcmONBd.tmp'
        at Error (native)
        at Object.fs.readdirSync (fs.js:761:18)
        at GlobSync._readdir (/usr/src/app/node_modules/glob/sync.js:275:41)
        at GlobSync._readdirInGlobStar (/usr/src/app/node_modules/glob/sync.js:254:20)
        at GlobSync._readdir (/usr/src/app/node_modules/glob/sync.js:263:17)
        at GlobSync._processGlobStar (/usr/src/app/node_modules/glob/sync.js:330:22)
        at GlobSync._process (/usr/src/app/node_modules/glob/sync.js:128:10)
        at GlobSync._processGlobStar (/usr/src/app/node_modules/glob/sync.js:363:10)
        at GlobSync._process (/usr/src/app/node_modules/glob/sync.js:128:10)
        at GlobSync._processGlobStar (/usr/src/app/node_modules/glob/sync.js:363:10)
    

    The project is an Ember 1.12 app w/ over 32,000 lines of code across 200+ files.

    I thought the issue was related to https://github.com/codeclimate/codeclimate-eslint/issues/1, but even disabling eslint surfaces the same error for the fixme engine instead. Seems to be something with the CLI itself, then.

    opened by elwayman02 34
  • Analyze simply hangs

    Analyze simply hangs

    When I run docker run \ --interactive --tty --rm \ --env CODE_PATH="$PWD" \ --volume "$PWD":/code \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume /tmp/cc:/tmp/cc \ codeclimate/codeclimate

    I get the help list with what commands are available

    Running docker run \ --interactive --tty --rm \ --env CODE_PATH="$PWD" \ --volume "$PWD":/code \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume /tmp/cc:/tmp/cc \ codeclimate/codeclimate analyze

    simply hangs with no output whatsoever. :confused:

    docker run \ --interactive --tty --rm \ --env CODE_PATH="$PWD" \ --volume "$PWD":/code \ --volume /var/run/docker.sock:/var/run/docker.sock \ --volume /tmp/cc:/tmp/cc \ codeclimate/codeclimate validate-config

    outputs: No errors or warnings found in .codeclimate.yml file.

    My .codeclimate.yml file:

    exclude_paths:
    - "src/vendor/*"
    - "app.js"
    engines:
      eslint:
        enabled: true
    

    Any help would be GREATLY appreciated - thanks.

    opened by robtarr 32
  • XDG config and cache

    XDG config and cache

    ⚠️ DO NOT MERGE ⚠️

    It apparently lack some Docker-specific parts.


    Adds global config for persistent UUID and version checks switch.

    Also adds some caching as well to prevent hitting Versions API too often.

    All implemented to XDG Base Directory Specification.

    opened by pointlessone 22
  • Improved Workspace Building

    Improved Workspace Building

    /cc @codeclimate/review

    This is the result of combining #300 & #302 and finishing up the remaining TODO items known from discussion on those 2 PRs.

    The big takeaways:

    • Calculation of the "workspace" (the set of paths an engine will operate on) is considerably more performant, and IMHO also conceptually simpler. Details of this were described in #302.
    • There's less magic, which also means some things the CLI used to do it no longer does:
      • Ignore .gitignore: we believe this was fairly low value, and is not worth the complexity & potential performance penalty some edge cases incurred.
      • Stop doing an enormous amount of permissions/file type checking: if there are unreadable files locally that an engine tries to read, the engine should either handle it reasonably well, or the user should exclude those directories from analysis.
    • New feature: per-engine excludes were made functionally trivial & entirely acceptable re: performance by this work, so they've been added.

    Open question for the team: I have not yet done serious work auditing how existing engines will behave with unreadable files/directories. @pbrisbin seemed to say in #300 that errors being thrown in cases like this was acceptable, since the exclude_paths should be configured to ignore those things. Put another way: noisy failure is preferable to quietly ignoring something. Opinions? Is that acceptable, or should we do some tests & consider engines that don't handle this case cleanly as blocking shipping of this?

    There are a couple CC complexity issues that popped up in the PathTree implementation: suggestions for improvements there are welcome. I've already improved that class from #302, and further improvements are not jumping out at me.

    Caveats:

    • Same as in #300, exclude paths are currently applied on top of explicit include paths (codeclimate analyze FILE), which can lead to unexpected behavior. In particular, due to how PathTree calculates its paths, you could end up analyzing all files if you attempted to explicitly analyze an excluded file. (This is because all_paths checks whether children were populated, and if they weren't it just returns its own root path -- including a file & then excluding it results in an empty set of children). Clearly that behavior is not correct, but before addressing that I think we should decide whether exclude paths should still apply when given explicit paths (i.e. in the case above the result should be no files to analyze), or should exclude paths be ignored when explicit paths have been provided?
    • Explicit includes also have an interesting edge case where if an invalid path is specified, the actual path analyzed will end up being the parent of whichever part of the path wasn't valid. (i.e. if you specify app/models/achtung, and achtung does not exist, the entire contents of app/models will end up being analyzed). This is down to the recursive nature of the algorithm and the fact that the data structure is implemented as mutable (the latter may have been a mistake, but it does simplify some things). Since include paths are always given on the command line, I'm not sure if we should consider this blocking or just worthy of a note for future attention.
    opened by wfleming 21
  • Add eslint-2 channel for eslint engine

    Add eslint-2 channel for eslint engine

    /cc @codeclimate/review

    I locally built and pushed an image from codeclimate/codeclimate-eslint#79 so it's now available to try. Consider this a quiet release for wider testing, it's entirely opt-in.

    opened by pbrisbin 18
  • I'm trying to install codeclimate cli on Windows 10 to make it work with atom.

    I'm trying to install codeclimate cli on Windows 10 to make it work with atom.

    I'm trying to install codeclimate cli on Windows 10 to make it work with atom. I followed the procedure:

    • Install docker
    • docker pull codeclimate/codeclimate

      I am not an experienced docker, so now what should I do to have a executable path to be given to atom?
      Thanks in advance.

    opened by XaBerr 18
  • Restore Glob Functionality to Workspace Refactor

    Restore Glob Functionality to Workspace Refactor

    I'm excited about the direction of #300, but I was concerned that completely removing glob support was overly extreme, and I'd had some thoughts while I was traveling about how it might be done performantly. This PR is my first draft at implementing those thoughts building on top of @pbrisbin's work.

    The key differences with our old technique are as follows:

    • Directory contents are never walked until they need to be due to explicit inclusions or exclusions. As a result:
      • The algorithm is much simpler than before: instead of a several-step process of collecting several disparate collections of paths, operating on relations between them, and then minimizing the resulting set, all operations are on a single sparse tree which is naturally minimized at all times.
      • Less overall file I/O & memory allocation for very large projects, since we're not walking every directory & building an in-memory list of every file path.
    • Only things that look like globs are treated like globs. Excluding directories by name instead of pattern works just fine.
    • There is no attempt to deal with unreadable files or symlinks or anything like that. (I think we'll still need to handle the case where a file we need to touch for interpreting an exclude can't be read, though).

    I went out of my way to keep the existing specs from #300 mostly unchanged, except for the sole case of no longer warning on glob usage (obviously), and adding a spec for globs working. I tried to minimize changing existing bits as well to make this easier to review & keep it clearer what I was changing. So this is more of a PoC or first draft than a finished proposal of implementation. That said, the basic structure is pretty much what I had in mind.

    As far as performance is concerned, this implementation works quite well on my local pathological case: it's indistinguishable from the current state of #300 as far as experienced performance goes. I'd like to write some actual code-based benchmarks before this ships so we'll have actual tests to tell us if the performance gets bad due to future changes.

    :eyes: @codeclimate/review


    TODOs:

    • [ ] This work means Workspace#dup is no longer safe for multiple-engines, because the dup is using the same instance of PathTree as the original. I'll need to fix that & should also update the relative workspace spec to actually test the dup functionality rather than just multiple #filter calls.
    • [ ] Handle potentially unreadable files when walking.
    • [ ] Do symlinks need any special treatment?
    • [ ] .git should be auto-excluded: that needs to be added.
    • [ ] Write some benchmarks.
    • [ ] make Specs test/use the results of a CC::YAML parse for both this class & Workspace.
    opened by wfleming 18
  • Can't configure a custom path for codeclimate-brakeman engine

    Can't configure a custom path for codeclimate-brakeman engine

    I have a custom directory structure and source files are not in the same directory where .codeclimate.yml is.

    Should be possible to configure a custom path, so codeclimate-brakeman can pass it to brakeman.

    When I run codeclimate-brakeman engine, I get this error:

    Running brakeman: Done!
    error: (CC::Analyzer::Engine::EngineFailure) engine brakeman failed with status 1 and stderr
    Please supply the path to a Rails application.
    
    enhancement 
    opened by wpolicarpo 16
  • eslint config path not getting passed to codeclimate-eslint

    eslint config path not getting passed to codeclimate-eslint

    I have a code_climate.yml file with a

      eslint:
        enabled: true
        channel: eslint-3
        config:
          config: path/to/.eslintrc.json
    

    but when I run codeclimate analyze -e eslint:eslint-3

    I get the error

    /usr/src/app/node_modules/eslint/lib/config.js:170
                throw noConfigError;
                ^
    
    Error: No ESLint configuration found.
        at getLocalConfig (/usr/src/app/node_modules/eslint/lib/config.js:162:35)
        at Config.getConfig (/usr/src/app/node_modules/eslint/lib/config.js:259:26)
        at Config.getConfig (/usr/src/app/lib/eslint-patch.js:34:46)
        at CLIEngine.getConfigForFile (/usr/src/app/node_modules/eslint/lib/cli-engine.js:776:29)
        at module.exports (/usr/src/app/lib/validate_config.js:9:22)
        at Object.<anonymous> (/usr/src/app/bin/eslint.js:236:5)
        at Module._compile (module.js:556:32)
        at Object.Module._extensions..js (module.js:565:10)
        at Module.load (module.js:473:32)
        at tryModuleLoad (module.js:432:12)
    

    as far as I can tell using CODECLIMATE_DEBUG=1 the path/to/.eslintrc.json is never getting sent to codeclimate-eslint

    opened by kjg 16
  • Support Apple M1

    Support Apple M1

    $ docker run \                                                                                       host Gabriels-MacBook-Air  pwd jobs  vcs intg-1505  ruby 2.7.2  node 14.15.4
      --interactive --tty --rm \
      --env CODECLIMATE_CODE="$PWD" \
      --volume "$PWD":/code \
      --volume /var/run/docker.sock:/var/run/docker.sock \
      --volume /tmp/cc:/tmp/cc \
      codeclimate/codeclimate help
    WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
    Usage: codeclimate COMMAND ...
    
    Available commands:
        analyze [-f format] [-e engine[:channel]] [path]    Run analysis with the given arguments
        console                                             Open a ruby console for the CLI. Useful for developing against the CLI.
        engines:install                                     Pull the latest images for enabled engines in your configuration
        engines:list                                        List all available engines
        help [command]                                      Display help information.
        prepare [--allow-internal-ips]                      Run the commands in your prepare step.
        validate-config                                     Validate your .codeclimate.yml or .codeclimate.json.
        version                                             Display the CLI version.
    
    opened by sobrinho 2
  • Support for mounting /code directory read-write when analyzing?

    Support for mounting /code directory read-write when analyzing?

    As shown in lib/cc/analyzer/engine.rb line 84 the code volume (mapped to /code in the analyzer) is mounted read-only. This prevents the usage of analyzers which need to generate extra files when performing analysis. For me personally, this prevents the use of the MISRA add-on when analyzing C code with cppcheck via a slightly modified version of the codeclimate-cppcheck analyzer. The MISRA add-on works by having cppcheck generate additional .dump files of the code and then using the .dump files to perform the MISRA analysis.

    Currently I'm working around this by generating the .dump files in an action that runs before my Code Climate cppcheck action that way the .dump files are present in the /code directory before analysis is performed. This isn't completely ideal though since have to manage two separate cppcheck actions.

    Would it be feasible to allow the /code directory to be mounted read-write when running certain analyzers? Maybe via a user config option or some other method?

    Some other discussion is here in the codeclimate-cppcheck repo: https://github.com/antiagainst/codeclimate-cppcheck/issues/41

    opened by lizalc 0
  • Auto ignore files declared on `.gitignore`

    Auto ignore files declared on `.gitignore`

    I faced an invalid json error while running the eslint plugin over a project. The root of the problem seems to be a memory allocation error. The CLI was analyzing files that I have under public/pacs where a lot of application-<hash>.js files live, this folder is ignored on .gitignore that's why I didn't face this issue when using the plugin on codeclimate.com. All this considered, it might be a good idea to auto ignore files declared on .gitignore

    opened by fede-moya 0
  • problem with CODECLIMATE_PREFIX with CODECLIMATE_DEV=1

    problem with CODECLIMATE_PREFIX with CODECLIMATE_DEV=1

    Hi there!

    I'm trying to use my own registry with the CLI. I think there are problems when we use CODECLIMATE_PREFIX with our custom engines. Maybe here we have not included prefix in the engine's command like in line 37 in the same file for default engine. Can you help me out with some workaround

    can you please help me fix this asap as there is an urgent need for completion of my project

    Edit: updated the link

    opened by iakshat 0
  • Allow import for external .codeclimate.yml configurations

    Allow import for external .codeclimate.yml configurations

    I am working on triggering code quality tests on multiple GitLab repositories from the CI/CD flow of a single GitLab project. We have decided on a .codeclimate.yml configuration that should work for all of our projects. It would be nice to not have to physically copy that configuration into every single project we intend to test, as there are likely 100+ and manually updating these in the case of a change to our default configuration would be quite cumbersome.

    While it's documented that you can use external configurations for engines, I don't see any documentation relating to using external .codeclimate.yml files. It would be great if we could instead include a configuration file like:

    # here you can see the ability to include several configurations 
    prepare:
      fetch:
      - url: "https://raw.githubusercontent.com/thoughtbot/guides/master/.codeclimate.yml"
        path: ".codeclimate.yml"
        name: cc_config_1
      - url: "https://raw.githubusercontent.com/thoughtbot/guides/feature/.codeclimate.yml"
        path: ".codeclimate.yml"
        name: cc_config_2
    
    # here you could specify which codeclimate configurations you would like to enable
    codeclimate:
      cc_config_1
        enabled: true
      cc_config_2
        enabled: false
    
    # below here would add to or override the included configuration
    plugins:
    ...
    

    I apologize if this feature already exists, but if it does, this could serve as a reminder that the documentation is unclear.

    opened by GarreBrenn 2
  • Incorrect volume mapping in docker run for engines

    Incorrect volume mapping in docker run for engines

    Hey guys, thanks a lot for the good work. Nonetheless, I believe there's an issue with how the wrapper runs the engines. I am trying to run the container in a gitlab pipeline with the following:

    code_quality:
      stage: test
      variables:
        NETWORK_MODE: host
      image:
        name: codeclimate/codeclimate
        entrypoint: ["/bin/ash", "-c"]
      script:
        - CODECLIMATE_DOCKER=1 CODECLIMATE_DEBUG=1 CODECLIMATE_CODE=/builds/<workspace>/<project>/ /usr/src/app/bin/codeclimate analyze
    

    and this is the output I get:

    $ CODECLIMATE_DOCKER=1 CODECLIMATE_DEBUG=1 CODECLIMATE_CODE=/builds/<workspace>/<project>/ /usr/src/app/bin/codeclimate analyze
    I, [2021-06-09T09:27:28.492917 #9]  INFO -- : starting engine structure
    D, [2021-06-09T09:27:28.496019 #9] DEBUG -- : /config.json content: {"enabled"=>true, "channel"=>"stable", "include_paths"=>["<file from repo>"], "debug"=>"1"}
    D, [2021-06-09T09:27:28.504171 #9] DEBUG -- : docker run: ["docker", "run", "--name", "cc-engines-structure-stable-009c6e74-434d-44df-a7c6-aa577b45f33b", "--cap-drop", "all", "--label", "com.codeclimate.label=63ddc812-5acd-4d0e-a2f3-f334af8a660b", "--log-driver", "none", "--memory-swap", "-1", "--net", "none", "--rm", "--volume", "/builds/<workspace>/<project>/:/code:ro", "--volume", "/tmp/cc/18cfcc2e-704c-4334-9912-7525b306d2fc:/config.json:ro", "--user", "9000:9000", "--memory", "1024000000", "codeclimate/codeclimate-structure"]
    D, [2021-06-09T09:27:28.780563 #9] DEBUG -- : engine stderr: 12
    D, [2021-06-09T09:27:28.780684 #9] DEBUG -- : engine stderr: Parser process id: 12
    D, [2021-06-09T09:27:28.781085 #9] DEBUG -- : engine stderr: codeclimate-parser socket not present
    D, [2021-06-09T09:27:28.781149 #9] DEBUG -- : engine stderr: waiting 1s...
    D, [2021-06-09T09:27:30.163807 #9] DEBUG -- : engine stderr: bin/structure:21:in `read': Is a directory @ io_fread - /config.json (Errno::EISDIR)
    D, [2021-06-09T09:27:30.163935 #9] DEBUG -- : engine stderr: 	from bin/structure:21:in `<main>'
    I, [2021-06-09T09:27:30.260833 #9]  INFO -- : finished engine structure`
    

    why is the tmp folder path mapped to config.json (/tmp/cc/18cfcc2e-704c-4334-9912-7525b306d2fc:/config.json:ro)?

    I guess the problem lies here (codeclimate/lib/cc/analyzer/engine.rb: line 76-92): especially line 85: "--volume", "#{config_file.host_path}:/config.json:ro",

    Thanks in advance. David

    opened by viddagrava 5
  • Suggestions regarding docker image

    Suggestions regarding docker image

    I followed the clear instructions of manually using the docker image, and after running the container, it took a long time to run. After running it in debug mode, I realized that it pulls additional >5GB containers.

    To me (and I am sure to some others), it looked like it just "hangs" since the pulling of the additional images takes way too long, and I know my project usually runs in a few seconds on the cloud service.

    So, based on this experience, I would like to suggest to update the docker pull instructions to instruct users to pre-download the additional images and not only the base image:

    $ docker pull codeclimate/codeclimate
    $ docker pull codeclimate/codeclimate-structure
    $ docker pull codeclimate/codeclimate-duplication
    

    In addition, I can say that these docker images are the largest I have ever seen, by a huge factor. I am guessing the reason is that they contain all the tools for all the languages. It would be much nicer to have smaller (<1GB) images, on a per-language basis, and even better - to have these images work without the need to use docker-in-docker.

    I know the chances of this happening are slim to none, but I thought I should mention it, in case someone else in the code climate team is thinking along these lines.

    opened by DannyBen 1
  • Updating to Rails 5.2.5 generates bundler-audit warnings

    Updating to Rails 5.2.5 generates bundler-audit warnings

    Screen Shot 2021-03-27 at 07 50 53

    Temporary workaround

    Modify the .codeclimate.yml file to mark the engine as disabled.

    engines:
      bundler-audit:
        enabled: false
    
    opened by fabiolnm 0
  • Unable to install cppcheck engine

    Unable to install cppcheck engine

    Using the command

     - docker run 
          --env CODECLIMATE_DEBUG=1 
          --env CODECLIMATE_CODE="$PWD" 
          --volume "$PWD":/code 
          --volume /var/run/docker.sock:/var/run/docker.sock 
          --volume /tmp/cc:/tmp/cc 
          codeclimate/codeclimate engines:list
    

    in CI job yml file displays the cppcheck engine but when I use this command afterwards:

        - docker run 
          --env CODECLIMATE_DEBUG=1 
          --env CODECLIMATE_CODE="$PWD" 
          --volume "$PWD":/code 
          --volume /var/run/docker.sock:/var/run/docker.sock 
          --volume /tmp/cc:/tmp/cc 
          codeclimate/codeclimate engines:install cppcheck
    

    It installs other engines and not cppcheck

    This is the output:

     Pulling docker images.
    Using default tag: latest
    latest: Pulling from codeclimate/codeclimate-structure
    Digest: sha256:bc756917f4c77560d8992d9ab56bb6018f0e7e6b524bc87a124a3c36d4e7695a
    Status: Image is up to date for codeclimate/codeclimate-structure:latest
    Using default tag: latest
    latest: Pulling from codeclimate/codeclimate-duplication
    Digest: sha256:e9499f11566ea96d5a5178f5ca5fad7b365dfb4ce1aa71fa24cb4073f3704ea5
    Status: Image is up to date for codeclimate/codeclimate-duplication:latest
    Using default tag: latest
    latest: Pulling from codeclimate/codeclimate-csslint
    Digest: sha256:20ce00b71ed8952203f7bb71051aec98bc5e156bcaf474bac3a23c54e8567bed
    Status: Image is up to date for codeclimate/codeclimate-csslint:latest
    Using default tag: latest
    latest: Pulling from codeclimate/codeclimate-coffeelint
    Digest: sha256:883cb9f842856187e2170dbfa21a86112a6cbba0de4a5ffa35213ba0c0ce4f48
    Status: Image is up to date for codeclimate/codeclimate-coffeelint:latest
    Using default tag: latest
    latest: Pulling from codeclimate/codeclimate-eslint
    Digest: sha256:6d862112509ca750b9ca5236f5db79e36f18c04e1f24d5a8f70fd452c0ae4cf5
    Status: Image is up to date for codeclimate/codeclimate-eslint:latest
    Using default tag: latest
    latest: Pulling from codeclimate/codeclimate-fixme
    Digest: sha256:a1d81814b1bcb2a08a5537aa956a566723daef4b1b02dd2bc6addf4d836a4a2d
    Status: Image is up to date for codeclimate/codeclimate-fixme:latest
    Using default tag: latest
    latest: Pulling from codeclimate/codeclimate-rubocop
    Digest: sha256:56fb4398a0594476a11e4cfc3d4a1e975b53b1da8bb66ef05cbb9da4f7d82518
    Status: Image is up to date for codeclimate/codeclimate-rubocop:latest
    

    and this is my .codeclimate.yml file

    version: "2" 
    plugins:
      cppcheck:
        enabled: true
        config:
          check: all
          language: c++
          stds:
            - c++11     
          platform: unix64
    
    opened by MrMelon1232 0
  • Add engine for Twig

    Add engine for Twig

    Could you add an engine for Twig, Eg. https://github.com/friendsoftwig/twigcs

    opened by MPParsley 2
Releases(v0.85.26)
Owner
Code Climate
Engineering Intelligence
Code Climate
Library for counting the lines of code in PHP source code

sebastian/lines-of-code Library for counting the lines of code in PHP source code. Installation You can add this library as a local, per-project depen

Sebastian Bergmann 440 Jan 12, 2022
PHP Static Analysis Tool - discover bugs in your code without running it!

PHPStan - PHP Static Analysis Tool PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even b

PHPStan 10.6k Jan 16, 2022
A PHP code-quality tool

GrumPHP Sick and tired of defending code quality over and over again? GrumPHP will do it for you! This composer plugin will register some git hooks in

PHPro 3.7k Jan 18, 2022
Copy/Paste Detector (CPD) for PHP code.

PHP Copy/Paste Detector (PHPCPD) phpcpd is a Copy/Paste Detector (CPD) for PHP code. Installation This tool is distributed as a PHP Archive (PHAR): $

Sebastian Bergmann 2.1k Jan 14, 2022
Analyze PHP code with one command

PHPQA Analyze PHP code with one command. Requirements PHP >= 5.4.0 xsl extension for HTML reports Why? Every analyzer has different arguments and opti

edgedesign/phpqa 531 Jan 5, 2022
Static code analysis to find violations in a dependency graph

PhpDependencyAnalysis PhpDependencyAnalysis is an extendable static code analysis for object-oriented PHP-Projects to generate dependency graphs from

Marco Muths 541 Jan 14, 2022
Performs advanced static analysis on PHP code

PHP Analyzer Please report bugs or feature requests via our website support system ? in bottom right or by emailing [email protected] Contri

Continuous Inspection 445 Nov 27, 2021
A static php code analysis tool using the Graph Theory

Mondrian Ok guyz, you have a master degree in Graph Theory, you follow Law of Demeter and you live on S.O.L.I.D principles ? Let's have some Fun ! (^ω

Florent Genette 386 Dec 2, 2021
Instant Upgrades and Instant Refactoring of any PHP 5.3+ code

Rector - Speedup Your PHP Development Rector helps you with 2 areas - major code changes and in daily work. Do you have a legacy code base? Do you wan

RectorPHP 4.8k Jan 13, 2022
Automagically generate UML diagrams of your Laravel code.

Laravel UML Diagram Generator Automagically generate UML diagrams of your Laravel code. Installation To install LTU via composer, run the command: com

Andy Abi Haidar 60 Jan 13, 2022
Provides functionality that helps writing PHP code that has runtime-specific (PHP / HHVM) execution paths

sebastian/environment This component provides functionality that helps writing PHP code that has runtime-specific (PHP / HHVM) execution paths. Instal

Sebastian Bergmann 6.2k Jan 12, 2022
Search PHP source code for function & method calls, variables, and more from PHP.

Searching PHP source code made easy Search PHP source code for function & method calls, variable assignments, classes and more directly from PHP. Inst

Permafrost Software 14 Aug 18, 2021
Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects

Deptrac is a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects. You can freely define your architectural layers over classes and which rules should apply to them.

QOSSMIC GmbH 1.8k Jan 12, 2022
The Stopwatch component provides a way to profile code.

Stopwatch Component The Stopwatch component provides a way to profile code.

Symfony 2.4k Jan 12, 2022
Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

PHP-Projects hacktoberfest Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to cha

Firmansyah Helmi Kurniawan 6 Oct 31, 2021
phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in PHP code

phpcs-security-audit v3 About phpcs-security-audit is a set of PHP_CodeSniffer rules that finds vulnerabilities and weaknesses related to security in

Floe design + technologies 595 Jan 9, 2022
💫 Vega is a CLI mode HTTP web framework written in PHP support Swoole, WorkerMan / Vega 是一个用 PHP 编写的 CLI 模式 HTTP 网络框架,支持 Swoole、WorkerMan

Mix Vega 中文 | English Vega is a CLI mode HTTP web framework written in PHP support Swoole, WorkerMan Vega 是一个用 PHP 编写的 CLI 模式 HTTP 网络框架,支持 Swoole、Work

Mix PHP 40 Jan 10, 2022
😎 Tracy: the addictive tool to ease debugging PHP code for cool developers. Friendly design, logging, profiler, advanced features like debugging AJAX calls or CLI support. You will love it.

Tracy - PHP debugger Introduction Tracy library is a useful helper for everyday PHP programmers. It helps you to: quickly detect and correct errors lo

Nette Foundation 1.5k Jan 13, 2022
A full-scale PHP 5.3.2+ sandbox class that utilizes PHPParser to prevent sandboxed code from running unsafe code.

##DEPRECATED: The PHPSandbox project has transfered to Corveda/PHPSandbox and will be actively maintained there. This branch is no longer being active

Elijah Horton 219 Jul 23, 2021
Mind is the PHP code framework designed for developers. It offers a variety of solutions for creating design patterns, applications and code frameworks.

Mind Mind is the PHP code framework designed for developers. It offers a variety of solutions for creating design patterns, applications and code fram

null 0 Dec 13, 2021
30 seconds of code Short PHP code snippets for all your development needs

30 seconds of code Short PHP code snippets for all your development needs Visit our website to view our snippet collection. Use the Search page to fin

30 seconds of code 2.5k Jan 14, 2022
Library for counting the lines of code in PHP source code

sebastian/lines-of-code Library for counting the lines of code in PHP source code. Installation You can add this library as a local, per-project depen

Sebastian Bergmann 440 Jan 12, 2022
Laravel quickly creates a verification code tool similar to Google verification code

laravel-gridCaptcha Laravel quickly creates a verification code tool similar to Google verification code laravel 快速创建一个类似于 Google 点图验证码的本地验证码扩展 介绍 lar

delete DB Flee 12 Dec 15, 2021
thinkphp6 quickly creates a verification code tool similar to Google verification code

tp-gridCaptcha thinkphp6 quickly creates a verification code tool similar to Google verification code thinkphp6 快速创建一个类似于 Google 点图验证码的本地验证码扩展 介绍 tp-g

听风吹雨 2 Oct 27, 2021
Result of our code-along meetup writing PHP 8.1 code

PHP 8.1 Demo Code This code demonstrates various PHP 8.0 and 8.1 features in a realistic, functional (but incomplete) codebase. The code is part of so

azPHP 2 Nov 14, 2021
⚗️ Adds code analysis to Laravel improving developer productivity and code quality.

⚗️ About Larastan Larastan was created by Can Vural and Nuno Maduro, got artwork designed by @Caneco, is maintained by Can Vural, Nuno Maduro, and Vik

Nuno Maduro 3.6k Jan 18, 2022
Free ZIP Code API - Free Access to Worldwide Postal Code Data

About Zipcodebase - Free Zip Code API Zipcodebase is a zip code API that was founded in 2019 to solve common issues with postal code data. As we have

SaaS Industries 3 Nov 17, 2021
Dead Code Detector (DCD) for PHP code.

This project is no longer maintained and its repository is only kept for archival purposes. PHP Dead Code Detector (PHPDCD) phpdcd is a Dead Code Dete

Sebastian Bergmann 405 Jan 18, 2022
Preload your sweet sweet code to opcache with a composer command, making your code faster to run.

Composer Preload Preload your sweet sweet code to opcache with a composer command, making your code run faster. Composer Preload is a composer plugin

Ayesh Karunaratne 190 Jan 11, 2022