Questions tagged [static-code-analysis]

Static code analysis is the analysis of computer software that is performed without actually executing it.

According to Wikipedia, Static code analysis is the analysis of computer software that is performed without actually executing programs (analysis performed on executing programs is known as ). In most cases the analysis is performed on some version of the source code, and in the other cases, some form of the object (byte) code. The term is usually applied to the analysis performed by an automated tool, with human analysis being called program understanding, program comprehension or .

510 questions
0
votes
0 answers

How to make WebStorm (or any IDE) warn on calling methods not defined in module?

This is the problem in its simplest form: (function() { 'use strict'; var module1 = { someMethod: function(a) {} }; var module2 = { anotherMethod: function(b) {} }; module2.someMethod(); })(); WebStorm (or any other IDE…
Alex.Me
  • 616
  • 3
  • 11
0
votes
1 answer

SonarLint displaying issues only in files changes

I'm looking to improve the code base of the department I'm working and I want to do it in a incremental way. My idea is that I only want to be running SonarQube and SonarLint in the files that the developer is changing. In sonarqube we…
0
votes
2 answers

Warning: main methods should not be directly called

I currently work on a Java project which has many main methods. Now, I do some refactoring, which affects all main methods. However, some of the main methods are actually called directly from other methods. I think this is bad style and it actually…
0
votes
1 answer

Static Code Analysis for possible merge conflicts in GIT

I am working on the problem of finding the possible conflicts during merging of two branches in git. I want to find the possible merge conflicts before merging the two branches and generate a report. I want to know if there are some solutions/tools…
lordzuko
  • 773
  • 10
  • 22
0
votes
0 answers

Visual Studio 2015 custom code analysis

I've been trying to test using custom code analysis rules for a database project in visual studio 2015 and have not been able to get it to work. I build the dll file and copy it in to the \Common7\IDE\Extensions\Microsoft\SQLDB\DAC\120\Extensions…
ryanw55
  • 83
  • 1
  • 1
  • 6
0
votes
1 answer

How to generate xml report using CPD (Copy Paste Detector)?

I am using the CPD tool to find the Duplicate codes in my project. I have tried the command line options as given in this link CPD Usage. I want to generate the report in xml format and need to store it in a particular location. But it is showing…
0
votes
1 answer

Change Name of RuleSet Modified from Microsoft's for Visual Studio

We mostly like the Microsoft All Rules ruleset that comes with Visual Studio for our project, but there are a few rules we want to skip. I see how to save a custom ruleset, and to integrate it into our project. The only thing I don't like is that…
user756366
  • 467
  • 6
  • 24
0
votes
1 answer

Finding inheritors of a class across branches of code

Has anyone attempted something similar to "find inheritors" or "find references" across branches? I'm working with a code base that includes multiple release branches, some of which differ from the main line. Fortunately, the base code is no…
0
votes
1 answer

Making all plugin specific rules strict

In eslint.json configuration, ESLint allows to configure rule strictness using the following logic: 0 - "off" 1 - "warning" 2 - "error" Example: { "rules": { "jasmine/valid-expect": 2, "eqeqeq": [2, "smart"] } } Question: Is it…
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
0
votes
0 answers

Precondition error detection using AST

I am developing a text editor for secure coding. Now I am in the case study stage. I found in the application of AST that Precondition error detection, Auto-completion are possible using AST. Do you have any idea or documents how the following will…
rahul b
  • 21
  • 3
0
votes
1 answer

Obtaining Code Clone Analysis Results grouped by File

As part of a code analysis report I've been asked to create, I need to rate the duplication of each file in a solution. To rate each file I am using a scale of 0 - 100 where the number corresponds to one of the categories in the Code Clone Analysis…
Sphynx
  • 135
  • 2
  • 12
0
votes
0 answers

How to find % of which methods of a particular library are being used?

I have several libraries in play, in many apps. I would like to determine which methods are used alot, a little or not at all by users categorized by their device, os, etc. Is there a grade plug in to do this out of the box? Or what keywords are…
sirvon
  • 2,547
  • 1
  • 31
  • 55
0
votes
1 answer

Doesn't Visual Studio 2015 Community edition support live code analyzer?

I have a Visual Studio 2015 professional (in Windows 7) and Visual Studio 2015 community (in Windows 10), both of have latest update 1 installed. And I have both of them opened the exactly same solution. Both tools also have Refactoring Essentials…
hardywang
  • 4,864
  • 11
  • 65
  • 101
0
votes
1 answer

Listing possible null dereference or forward null in CPP source code

Is there a tool which can do static analysis and find possible forward null and possible null dereference cases. I know coverity is pretty much used and also cpp check. But I dnt find it usefull when comes to user defined data-type comes to…
0
votes
0 answers

Check which browsers JavaScript code will work on

How can I check which browsers my JavaScript code (which contains some jQuery) will work on? For example, is there any way to analyse a piece of code, have it detect that it contains forEach, and indicate that it doesn't work with certain versions…
Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338