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

error with SAlib library for Sensitivity analysis in python

I am trying to perform sensitivity analysis using Sobol`s method. I always get an error which i can not solve. the code and the result are below. the input variable ranges are identified in problem and the output of the model are saved in…
Omar Ali
  • 85
  • 1
  • 10
1
vote
2 answers

null-conditional operator and CA2202: Do not dispose objects multiple times

Having the following: StringWriter sw = null; try { sw = new StringWriter(); using (var xw = new XmlTextWriter(sw)) { doc.WriteTo(xw); return sw.ToString(); } } finally { sw?.Dispose(); } triggers the CA2202 (do…
1
vote
0 answers

MLE of Weibull using R

I am at the beginning of the study of the language R-programming, and I try to analyse the MLE of this paper "Parameter Estimations for Some Modifications of the Weibull Distribution " This my…
Hamada Al
  • 111
  • 1
1
vote
1 answer

How to utilize code analysis with no default branch

I'm currently trying to setup some code analysis for my team however I found our release process does not mesh well with the tools I have looked into (CodeClimate and SonarQube). Both tools require a default branch to track the state or "grade" of…
Michael
  • 679
  • 7
  • 24
1
vote
1 answer

Can symbolic execution tool KLEE run in parallel?

According to their paper (OSDI'08), symbolic execution tool KLEE needs about 1 hour to generate test cases for a single COREUTIL application. I am wondering if it can run in parallel?(say, multi-threaded on multicore or even GPU)?
JackWM
  • 10,085
  • 22
  • 65
  • 92
1
vote
0 answers

Getting the name of an operand or a result

I am currently doing a static analysis on c code with llvm(via LLVM IR). I first transform the c code into .ll file, then I am parsing it with LLVM-Framework. The IR that I'm using is in SSA-form, so every result of an instruction is distinctive.…
izazu
  • 87
  • 9
1
vote
1 answer

OPAM "Illegal Instruction: 4" for Infer Static Analyzer

Currently I am trying to run opam commands but they return illegal instruction 4. I have the latest version of homebrew installed, OSX El Capitan 10.11.1 on a Mid 2010 Mac Book Pro. I have opam installed and linked but every time I try "opam init -y…
Fizzymike
  • 31
  • 1
  • 5
1
vote
3 answers

Suggested thresholds for some software metrics

I was searching the internet for some suggestions for thresholds for the following well-known software product metrics: Lack of Cohesion in Methods (for the Henderson-Sellers variant of the metric) Number of Inherited Methods in a Class Number of…
1
vote
0 answers

JavaScript static analyser that catches non-existing property names

Say, I have a React component like this: var Wizard = React.createClass({ planAllowsConfigType: function(configType) { return true; }, render: function() { // Note type in planAlowsConfigType var output =…
Gezim
  • 7,112
  • 10
  • 62
  • 98
1
vote
2 answers

Ensure that fields with specific annotations are 'private'

Very common mistake in our code is to write @Mock Object object; @InjectMocks Subject subject; instead of @Mock private Object object; @InjectMocks private Subject subject; This prevents PMD/FindBugs/IntelliJ from issuing warning when the field…
Michal Kordas
  • 10,475
  • 7
  • 58
  • 103
1
vote
2 answers

VS 2015 Hangs when I try to export the code analysis results

I'm working on VS 2015 Enterprise, the problem is like follows: I executed the static code analysis tool on a project. The error pane showed me near 100000 cases, but when I tried to export all of them into excel, VS 2015 hangs. Please let me know…
1
vote
3 answers

Syntax/code style/writing checking tool for Markdown files

Is there a static "code" analysis tool that can check the syntax of a Markdown file? It would also be great to have a tool that validates a Markdown file against certain rules such as, e.g., Checkstyle does for Java and Pylint for Python. I want to…
box
  • 3,156
  • 3
  • 26
  • 36
1
vote
2 answers

A warning with cppcheck, "hides typedef with same name"

This is a cppcheck warning message. Variable 'BUFFER_INFO' hides typedef with same name The BUFFER_INFO is defined as following. typedef struct tagBufferInfo { CRITICAL_SECTION cs; Buffer* pBuffer1; Buffer* pBuffer2; Buffer*…
Benjamin
  • 10,085
  • 19
  • 80
  • 130
1
vote
1 answer

Where is the extension/extensibility point for vs2010 code metrics?

I'd like to extend the 2010 static code analysis metrics (mostly fix it so the rollup is max instead of sum). Where is the extensibility point? Is it an MEF component somewhere?
Maslow
  • 18,464
  • 20
  • 106
  • 193
1
vote
0 answers

Do any of the static analysis tools allow you to require @Override?

It'd be nice to be able to tell if you're accidentally overriding a method in a subclass, I know that java doesn't have a constraint to do this (be nice if it did), do any of the static or bytecode analysis tools allow you to require the @Override…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243