Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Java static code analysis tool Infer     - To install Docker under Ubuntu 15.04 (Linux)

- Linux loopback adapter Driven Design (Programming)

- How to deploy Icinga client (Server)

- Installation and Configuration Munin monitoring server on Linux (Server)

- Briefly explain the invasion of the four-level denial of service attack DoS Linux server (Linux)

- Doubly linked list basic operations (Linux)

- Introduction to thread pooling and simple implementation (Programming)

- HTML5 postMessage cross-domain data exchange (Programming)

- Using BBED repair ORA-01190 error (Database)

- CentOS How to mount the hard drive (Linux)

- Teach you how to choose to install CentOS 6.5 installation package (Linux)

- Java look and feel mode (Facade mode) (Programming)

- S5PV210 development board for embedded development environment to build under Ubuntu (Linux)

- The wrong in Linux: too many open files (Linux)

- RegExp object implements regular match --JavaScript (Programming)

- VMware Workstation virtual machine Ubuntu achieve shared with the host (Linux)

- MySQL multi-master-slave synchronization (Database)

- Ubuntu 12.04 installation instructions under GAMIT10.40 (Linux)

- Using Linux / Unix Text processing (Linux)

- Verify the character set on MyCAT (Database)

  Java static code analysis tool Infer
  Add Date : 2017-08-31      
  One, Infer presentation

Infer Facebook is the latest source of static program analysis tools for mobile applications prior to release of the code analysis to identify potential problems. Facebook currently using this tool to analyze the Facebook App, including Android, iOS, Facebook Messenger and Instagram like.

Facebook said the tool to help them every month to check out potential applications of hundreds of Bug, such as some null pointer access, resource and memory leaks and so on. Infer the Java support Android and iOS C and Objective-C code.

Infer in GitHub homepage: https://github.com/facebook/infer

Two, Infer use

1, the top command
Infer the main command runs. It is actually a python script.
Infer run tests Shell scripts. It uses the Buck to run the tests.
 Usage: inferTest {c, objc, java}
It is a Python script for errors Infer flow test report, the tracking error.

2, the auxiliary command
InferJava: contains the Java binaries tip
InferClang: Clang tip contains binaries
InferAnalyze: contains Infer backend (perform analysis) binaries
InferPrint: Output analysis (bug found in the list, for example, etc.) binaries
inferJ: Run Java file parsing command
BuckAnalyze: Buck Run as compiled Java project analysis command
Other scripts inferlib.py:Python library
Other scripts utils.py:Python library
Other scripts jwlib.py:Python library

Three, Infer installation

 Official provides precompiled Infer tool, but supports only two Linux and MacOS platforms. If you prefer to use Infer, you can use the direct download.
 Otherwise, you need to download the source code, compile it yourself.

1, download Infer
Can be downloaded from the Git repository Infer, the command:

1. git clone https://github.com/facebook/infer.git

Note: If you want to analyze C and Objective-C, Infer need clang and facebook-clang-plugin plug.
facebook-clang-plugin plugin see: https://github.com/facebook/facebook-clang-plugins
If you want to analyze Java / Android code, you do not need more than one dependent libraries.

2, Infer installed in the Linux
 Prerequisites: You need Python 2.7 or later

 Installation instructions:
 (Following installation verification procedure in Debian 7, Ubuntu 14.04 and Ubuntu 12.04.4 LTS other systems via)

1. Install OCaml dependent

# Sudo apt-get update
# Sudo apt-get upgrade
# Sudo apt-get install git openjdk-7-jdk m4 zlib1g-dev python-software-properties build-essential libgmp-dev libmpfr-dev libmpc-dev unzip
# Wget https://github.com/ocaml/opam/releases/download/1.2.2/opam-1.2.2-x86_64-Linux -O opam
# Chmod + x opam
# ./opam Init --comp = 4.01.0 # then press "y" in the last issue of the
# Eval `./opam config env`
# ./opam Install sawja.1.5 atdgen.1.5.0 javalib.2.3 extlib.1.5.4 # then press "y" in the question of the
2. If you do not need to support C and Objective-C code static analysis, continue with the following instructions:

# Cd infer
# Make -C infer java
# Export PATH = `pwd` / infer / bin: $ PATH
Note: does not support Java 8

3. If you need to support both Java code, and supports C and Objective-C code, then do not perform step 2 above to step 3 here.
Assumptions and 4.7.2 or later installed GCC (if OS is Ubuntu 12.04.4 LTS, then you have installed gcc g ++ version 4.8 and version 4.8.
Then execute the following command:

# Sudo apt-get install python-software-properties
# Sudo add-apt-repository ppa: ubuntu-toolchain-r / test
# Sudo apt-get update
# Sudo apt-get install gcc-4.8 g ++ - 4.8
# Sudo update-alternatives --install / usr / bin / gcc gcc /usr/bin/gcc-4.8 60 --slave / usr / bin / g ++ g ++ /usr/bin/g++-4.8
4. Then continue

# Cd infer
# ./update-fcp.sh
# ../facebook-clang-plugin/clang/setup.sh # Go have a coffee :)
# ./compile-fcp.sh
# Make -C infer
# Export PATH = `pwd` / infer / bin: $ PATH

Four, Infer another installation

1. Download
You can also directly download binaries
Mac OS X version: https://github.com/facebook/infer/releases/download/v0.1.0/infer-osx-v0.1.0.tar.xz
Linux distributions: https://github.com/facebook/infer/releases/download/v0.1.0/infer-linux64-v0.1.0.tar.xz

2, the installation
Extracting Binary Distribution

# Tar xf infer-linux64-v0.1.0.tar.xz
Then creates infer-linux64-v0.1.0 directory, Infer the main executable located infer-linux64-v0.1.0 / infer / infer / bin directory.

3, to add to the PATH environment variable Infer

# Cd infer-linux64-v0.1.0 &&
# Echo "export PATH = \" \ $ PATH: `pwd` / infer / infer / bin \" "\ >> ~ / .bash_profile &&
# Source ~ / .bash_profile
- MySQL & NoSQL - Memcached widget (Database)
- Linux security settings Basics (Linux)
- NAT (network address translation) Realization (Linux)
- Linux under HAProxy + Keepalived dual-availability program (Server)
- How to migrate MySQL to MariaDB under linux (Database)
- Linux common commands: nslookup, ls md5sum, uname, history, etc. (Linux)
- Easy to install Ubuntu 15.04 and Ubuntu 15.04 GNOME on Wayland trial (Linux)
- DataGuard the MRP can not start to analyze and solve problems (Database)
- MySQL EXPLAIN SQL output description (Database)
- CentOS 7.0 Automatic installation CD-ROM production Comments (Linux)
- Use SecureCRT to transfer files between Linux and Windows (Linux)
- Java Graphics2D Paint (Programming)
- STL in the list of erase () method (Programming)
- NaSC using simple mathematical operations on Ubuntu and Elementary OS (Linux)
- Oracle RAC upgrade to problems encountered (Database)
- Snort build a secure Linux server (Linux)
- Installing software on Ubuntu: apt-get and dpkg difference (Linux)
- Use ISO document production OpenStack used CoreOS mirror (Linux)
- How LUKS encrypted disk / partition to perform remote incremental backup (Linux)
- Android memory optimization of the memory cache (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.