Questions tagged [static-analysis]

"Static Analysis" refers to the software tools (or their use) to analyze application code for arbitrary properties, such as errors (uninitialized variables, possible SQL injection-attack, is this code-dead, can an argument be null,...) or structure (what is the call graph for this code? is there duplicate code? what information is passed between components?).

Static analysis refers to the software tools (or their use) to analyze application code for arbitrary properties, such as errors (uninitialized variables, possible SQL injection-attack, is this code-dead, is there duplicate code, can an argument be null), or structure (what is the call graph for this code? what information is passed between components?).

The variety of questions that one might ask about application properties is endless. Usually, one needs a tool customized to answer each individual question, for each individual language. And each such tool typically requires a lot of engineering, as most of them have to contain a significant part of a compiler front end just to read the source code and understand the meaning of the source code entities. Consequently, such tools are rare for the specific question you want to ask; where they exist, there are as many static analysis software tools are there are questions, although often a set of questions are rolled up into a single tool.

(In contrast, dynamic analysis refers to collecting data about interesting properties as an application program actually executes, e.g., "did this sum overflow at runtime?". In principle, a static analysis tool can provide exactly the information that dynamic analysis can, just by simulating the execution of the program, but its a lot of work to build such a simulator when there's already a computer lying around that is willing to do it for no extra effort.)

2152 questions
1
vote
1 answer

Proper choice of rules in VS2010's static analyzer

There are many groups in VS2010's static analyzer: All Rules Basic Correctness Rules Basic Design Guideline Rules Extended Correctness Rules Extended Design Guideline Rules Globalization Rules Minimum Recommended Rules Security Rules But it…
Benjamin
  • 10,085
  • 19
  • 80
  • 130
1
vote
1 answer

GrammaTech CodeSonar - output to CSV

I need to export GrammaTech CodeSonar's analysis from my browser's hub to a CSV. However, I want to include my Notes, but don't know how to include them in the export. Please tell me how to export my Notes, along with the other rows. Thanks
Kevin Meredith
  • 41,036
  • 63
  • 209
  • 384
1
vote
1 answer

Where to set include path for static code analyzer in Spyder

Using Spyder Python(3.4) IDE version 3.0.0 on Windows. I've set custom include paths via the PYTHONPATH Manager, but upon execution of the static code checker, I'll get "Unable to import [...]" error messages and further errors based on the missing…
Chaos_99
  • 2,284
  • 2
  • 25
  • 29
1
vote
1 answer

Gimpel's PC-lint can't trace dangling pointer?

I've been using PC-lint9 to find out different errors recently and it really blow my mind, but it seems PC-lint9 can't trace dangling pointer, here is snapshot of the code I exam with. int* pkInt = new int; int* pkDangInt = pkInt; delete pkInt; (…
eddielu
  • 13
  • 3
1
vote
1 answer

Why is it better to statically resolve XML QNames than to dynamically resolve XML QNames?

A QName is a namespace-qualified name. Here is XML containing two QNames: 12,000 feet The two abbreviated QNames are: ac:aircraft ac:altitude The…
Roger Costello
  • 3,007
  • 1
  • 22
  • 43
1
vote
0 answers

Get the external methods details with static analysis

I am developing a static analyzer for objective-c and I need details about the external methods that are called in the code (the declaring class, the return type and the arguments). Is there a way or a tool that allows me to have this information ?…
1
vote
1 answer

forward slice in WALA IR

Is there a way to calculate a forward slice at the IR instruction-level in WALA (rather than statement level)? I'm interested in the forward slice for tainted data intra-procedurally, so I'd like the slice to consist of the IR instructions…
JPC
  • 1,891
  • 13
  • 29
1
vote
1 answer

SonarQube for iOS vs Xcode code analysis

I want to know if i should install sonarQube for iOS what are the pros and cons and is there a free version / trial that i can use. Plus a guide how to set and use it properly. Thanks for the help.
rony_y
  • 535
  • 1
  • 8
  • 26
1
vote
1 answer

Resharper CLI Instability and Machine Set-up

I'm trying to use the Resharper CLI tools within our CI set-up to perform static code analysis. I've tried this on two different VMs and got very different results, on one machine everything seems to work fine on another it seems very…
user3617723
  • 1,355
  • 3
  • 17
  • 37
1
vote
3 answers

Authenticate sonar-runner via basic auth

Our sonarqube server is behind http basic authentication and local runner fails with 401 error. Is it somehow possible to provide credentials to it? AOfficial docs shows how to provide sonarqube's internal user... UPD #1: sonarqube:…
nKognito
  • 6,297
  • 17
  • 77
  • 138
1
vote
1 answer

How can I cast the expression to get rid of QAC warning?

I'm using QAC and I get the below message for the respective source code line. How can I cast it in order for QAC to "understand" it ? Compiler used is gcc - it doesn't warn about this issue, as it is set to "iso c99". #define…
1
vote
2 answers

How can abstract intepretation in static analysis be used without formal specification

Recently I have read a lot about formal verification and I am fascinated by the topic. Yet I cannot figure out the following: Formal verification requires a formal specification so how can be abstract interpretation used on any source code in…
John V
  • 4,855
  • 15
  • 39
  • 63
1
vote
2 answers

Get statistics on a C# WAP Project for client communication

I have a client that thought a highly dynamic ASP.NET application was a very simple sytem, yet to implement it in the manner in which they needed for future grown it has grown to well over 100 different code files. I am looking for a way, most…
Mitchel Sellers
  • 62,228
  • 14
  • 110
  • 173
1
vote
1 answer

C source-code parser

I am trying to make a tool that can detect a change impact on C source-code. Impacted variables, functions or interfaces, i was thinking about making my own static code analyzer using language grammar rules based on the different forms of…
A.Thabet
  • 113
  • 3
  • 9
1
vote
1 answer

Testing & Analysis of Shell (Bash) Scripts?

I'm working on a project where we deploy our software to Linux machines. This involves a whole load of Bash, for example, the init scripts (e.g. service foo start for SysVinit. My big concern is that we don't test these the way we test the…
Boon
  • 1,073
  • 1
  • 16
  • 42