Facebook OSS static analysis tool "infer" http://fbinfer.com/ java analyzes where (potentially) a slimy spot occurs and about memory leaks. In the analysis of Nullpo, it seems to be much stronger than findbugs, so I wanted to put it in, but it is not compatible with Windows. There was docker for the time being, so I managed to run it with docker-toolbox.
https://www.docker.com/products/docker-toolbox Get from here
Create an infer directory directly under C (anywhere else is OK)
Start Docker Quickstart Terminal.
Get the Dockerfile and launch shell.
$ curl https://raw.githubusercontent.com/facebook/infer/master/docker/Dockerfile > /c/infer/Dockerfile
$ curl https://raw.githubusercontent.com/facebook/infer/master/docker/run.sh > /c/infer/run.sh
Is the Dockerfile buggy when you hit the shell as it is? (As of June 9, 2017) It will fail, so I will modify the Dockerfile a little. Modified as below
# Base image
FROM buildpack-deps:xenial-curl
MAINTAINER I2
# Debian config
RUN apt-get update && \
apt-get install -y --no-install-recommends \
aspcud \
autoconf \
automake \
gcc \
g++ \
git \
groff-base \
libc6-dev \
libgmp-dev \
libmpc-dev \
libmpfr-dev \
m4 \
make \
ncurses-dev \
ocaml \
opam \
openjdk-8-jdk-headless \
pkg-config \
python2.7 \
rsync \
unzip \
zlib1g-dev && \
rm -rf /var/lib/apt/lists/*
# Download the latest Infer release
RUN git clone https://github.com/facebook/infer.git
RUN cd infer && ./build-infer.sh java
ENV PATH $PATH:/infer/infer/bin
Hit the shell
$ cd /c/infer
$ ./run.sh
Wait a long time. It will move.
You can pass it through example, but if you clone it from git, you can analyze it for existing projects.
I want to write another article about how the analysis of Nullpo is amazing
Recommended Posts