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
3 answers

global buffer overflow, Windows environment

I've asked a question about buffer overflow detection few days ago ( sprintf buffer global data overflow - how to detect it, Windows ) and problem can by only solved by cppcheck with standard function ( not secure _s version ). I went deeper and…
bataliero1234
  • 145
  • 10
1
vote
4 answers

sprintf buffer global data overflow - how to detect it, Windows

I am wondering if it's possible to detect this kind of buffer overflow somehow in Windows. Buffer is global ( not on stack ) so /RTC in Visual Studio 2008, VS2012 is not checking it. MinGW gcc also failed. #include char buffer[2]; void…
1
vote
1 answer

Show warnings for methods longer than x lines in Xcode

Is there a way how to check source code files (Objective C) and show warning for methods/functions that are longer than x lines (where the x can be configured). Something that can be integrated in Xcode would be great. I have looked into these two…
Tom Kraina
  • 3,569
  • 1
  • 38
  • 58
1
vote
2 answers

Are there any tools that can "find references" to built in ops?

I was reading the explanation under this item in the Google C++ style guide and it got me thinking; are there any tools that work like VS's "Find all references" tool but for built in ops and the like? For example say I want to find all places where…
BCS
  • 75,627
  • 68
  • 187
  • 294
1
vote
2 answers

Finding all methods that uses a specific method directly or indirectly in native c++

Is there any tool for discovering all direct or indirect method usage for a specific method in c++. For managed classes NDepend does the job "Select method that are using me", however I am struggled how to do it in native classes. Visual Studio's…
pappati
  • 171
  • 1
  • 9
1
vote
1 answer

Intermediate Representation (IR) Memory Management in static analysis

I am curious to know : what is current state of art in memory managemnet of IR during Interprocedural Data flow Analysis. I want to know does IR for complete code resides in the memory during analysis or some memory management techniques are applied…
1
vote
0 answers

Splint (C static analyser): analysing thread safety of interrupt service routines

I'm compiling for a basic microcontroller in C that has just one interrupt priority level; there is just one ISR. I would like to be warned of thread safety issues, between the ISR and the main() thread. Is this something static analysers can do?…
Jodes
  • 14,118
  • 26
  • 97
  • 156
1
vote
0 answers

FindBugs and Nonnegative annotation (jsr 305)

Has anyone got @Nonnegative to work with FindBugs, maybe FindBugs contrib ? Which package do you use, javax.annotation ? Any other tool to check it (apart of IntelliJ) ?
Christophe Roussy
  • 16,299
  • 4
  • 85
  • 85
1
vote
1 answer

Sonar Eclipse plugin : local analysis is still tagging fixed issues

I'm using the Sonar Eclipse plugin v3.3. After I've fixed a rule violation, not a new issue, but one that exists on the sonar server, I re-run the analysis on my project in Eclipse. I expected that the fixed issues would no longer be flagged by the…
1
vote
0 answers

How can I analyse my JS program to ensure a particular method is always called with 2 arguments?

We're using promises in an AngularJS project and want to ensure that the then method is always called with 2 arguments, the 2nd being an error handler, like so: $http.get(url).then(function () { console.log('hooray!'); }, function (error) { …
afternoon
  • 1,285
  • 16
  • 25
1
vote
2 answers

static analysis of open source projects

we started with static code analysis and I would like to see how we compare with other projects. Now I am aware I could go out and run tools for different OS projects, but I was curious if there is a repository for this data. such as cyclomatic…
zebra
  • 1,330
  • 1
  • 13
  • 26
1
vote
1 answer

Visual Studio 2013 incorrect namespace errors

Visual Studio 2013 keeps reporting namespace reference errors, even while the build is successful: Even namespaces/classes in our code cannot be found at times: All while our build is still successful. Sometimes we have to code blind because we…
Dave New
  • 38,496
  • 59
  • 215
  • 394
1
vote
3 answers

Treating language errors and runtime errors differently in python

I have a decent sized code in python which I changed a bit and now I see that when executing the code, the script does not bail on language errors like missing function definitions. I did not think it was possible to continue running a script with…
user220201
  • 4,514
  • 6
  • 49
  • 69
1
vote
1 answer

type of security testing in web based application

looking for Type of Security testing are dynamic and static analysis part of security testing? as QA tester do we need to know programming or coding language knowledge to perform security testing? at what phase of STLC or SDLC we can perform…
binitsql
  • 67
  • 2
  • 10
1
vote
1 answer

Fixing CWE-288 Authentication Bypass Using an Alternate Path

I have this piece of code which I thought was a fairly standard way of redirect to another servlet RequestDispatcher dispatch = request.getRequestDispatcher("/ApplicationExceptionHandler"); dispatch.forward(request,…