static-analysis

Is using static bytecode analysis to determine all the possible paths through a given method a variant of trying to solve the Halting Problem?

我的梦境 提交于 2019-12-02 01:27:41
问题 Is it possible to determine all the possible execution paths by reading the bytecode of a given method, or will that be equivalent to trying to solve the halting problem? If it can't be reduced to the halting problem, then how far can I go with static analysis without crossing the boundary of trying to solve the halting problem? Related question: "Finding all the code in a given binary is equivalent to the Halting problem." Really? 回答1: Yes, this is easily equivalent to solving the halting

OCLint not in system path

房东的猫 提交于 2019-12-02 00:04:58
I have an Xcode project. I tried to integrate OcLint in it. But it says there is no OCLint.How can I download and add OCLint to my system path so that I can integrate OCLint in my xcode project. EDIT: When I have a partof OCLint script as hash oclint &> /dev/null if [ $? -eq 1 ]; then echo >&2 "oclint not found, analyzing stopped" exit 1 fi It gives oclint not found, analyzing stopped . Please give me a solution for this. You can download oclint from : http://archives.oclint.org/nightly/oclint-0.9.dev.02251e4-x86_64-darwin-14.0.0.tar.gz To integarte into your xcode project u could use this

A PHP regex to extract php functions from code files

坚强是说给别人听的谎言 提交于 2019-12-01 23:49:08
I'm trying to make a PHP regex to extract functions from php source code. Until now i used a recursive regex to extract everything between {} but then it also matches stuff like if statements. When i use something like: preg_match_all("/(function .*\(.*\))({([^{}]+|(?R))*})/", $data, $matches); It doesn't work when there is more than 1 function in the file (probably because it uses the 'function' part in the recursiveness too). Is there any way to do this? Example file: <?php if($useless) { echo "i don't want this"; } function bla($wut) { echo "i do want this"; } ?> Thanks regexps is the wrong

Is using static bytecode analysis to determine all the possible paths through a given method a variant of trying to solve the Halting Problem?

廉价感情. 提交于 2019-12-01 22:42:41
Is it possible to determine all the possible execution paths by reading the bytecode of a given method, or will that be equivalent to trying to solve the halting problem? If it can't be reduced to the halting problem, then how far can I go with static analysis without crossing the boundary of trying to solve the halting problem? Related question: "Finding all the code in a given binary is equivalent to the Halting problem." Really? Yes, this is easily equivalent to solving the halting problem. Consider the following if statement: if (TuringMachine(x)) then goto fred; OK, is it really possible

VB.NET Static Code Anaylsis

▼魔方 西西 提交于 2019-12-01 18:13:10
Does anyone know of a good code static code analyser for vb.net? I've seen plenty for c#, and I think VS 2008 some one built in. But we're currently only using vs 2005... FxCop does just that. Specific for VB.NET is Project Analyzer . Depending on what you are looking for Fortify is another application that analyzes code really well, but it isn't a VB specific, works for all of .net You can use the tool NDepend which analysis all .NET code (C#, VB.NET, F#...). For VB.NET code you'll miss 2 metrics on source code comment and source code cyclomatic complexity (but you still have CC computed from

VB.NET Static Code Anaylsis

╄→гoц情女王★ 提交于 2019-12-01 17:43:27
问题 Does anyone know of a good code static code analyser for vb.net? I've seen plenty for c#, and I think VS 2008 some one built in. But we're currently only using vs 2005... 回答1: FxCop does just that. Specific for VB.NET is Project Analyzer. 回答2: Depending on what you are looking for Fortify is another application that analyzes code really well, but it isn't a VB specific, works for all of .net 回答3: You can use the tool NDepend which analysis all .NET code (C#, VB.NET, F#...). For VB.NET code

Java for each loop being flagged as UR anomaly by PMD

怎甘沉沦 提交于 2019-12-01 14:59:22
I would like to confirm if this is a bug on PMD? How do I file a ticket if it is. public static void main(final String[] args) { for (final String string : args) { string.getBytes(); //UR Anomaly } for (int i = 0; i < args.length; i++) { args[i].getBytes(); } } Lines 1-3 are being flagged as UR anomaly, while rewriting it to iterate with a local variable is fine. Would like to eliminate as much PMD violations, but it is inconvenient to have to resort to old loop construct as a workaround. While controversial, I do not wish to disable this rule since I find DD, and DU anomaly flagging as useful

How does one implement FxCop / static analysis on an existing code base

家住魔仙堡 提交于 2019-11-30 15:26:03
What are some of the strategies that are used when implementing FxCop / static analysis on existing code bases with existing violations? How can one most effectively reduce the static analysis violations? Make liberal use of [SuppressMessage] attribute to begin with. At least at the beginning. Once you get the count to 0 via the attribute, you then put in a rule that new checkins may not introduce FxCop violations. Visual Studio 2008 has a nice code analysis feature that allows you to ensure that code analysis runs on every build and you can treat warnings as errors. That might slow things

How to exclude files from Eclipse indexing (Static Code Analysis)?

帅比萌擦擦* 提交于 2019-11-30 14:52:41
问题 I have a makefile project comprised of many source, header and other files, which I am trying to convert to an Eclipse "native" project. The problem that the Indexer reports errors and warning on files that exist in the directories but are excluded form the build. As a consequence, large parts of my directory tree are marked with the red x sign. How can I make the Indexer to ignore specific file and/or directories? Note: when defining a directory as "Derived" it is excluded form further

Detect pointer arithmetics because of LARGEADDRESSAWARE

蓝咒 提交于 2019-11-30 13:27:16
I would like to switch my application to LARGEADDRESSAWARE. One of issues to watch for is pointer arithmetic, as pointer difference can no longer be represented as signed 32b. Is there some way how to find automatically all instances of pointer subtraction in a large C++ project? If not, is there some "least effort" manual or semi-automatic method how to achieve this? PC-Lint can find this kind of problem. Look at http://gimpel-online.com/MsgRef.html , error code 947: Subtract operator applied to pointers -- An expression of the form p - q was found where both p and q are pointers. This is of