code-analysis

How do I fix PyDev “Method should have self as first parameter” errors

孤街浪徒 提交于 2019-12-22 03:52:56
问题 I'm developing in Python using PyDev in Eclipse, and some of my code generates errors in the code analysis tool. Specifically: class Group(object): def key(self, k): class Subkey(object): def __enter__(s): self._settings.beginGroup(k) return self def __exit__(s, type, value, tb): self._settings.endGroup() return Subkey() Gives me a "Method '__enter__- group' should have self as first parameter" error, and a similar error for __exit__ . Is there a way to solve this without assigning self to

What duplication detection threshold do you use? [closed]

可紊 提交于 2019-12-21 20:52:45
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . We all agree that duplication is evil and should be avoid (Don't Repeat Yourself principle). To ensure that, static analysis code

Valgrind automatic tests — are they used somewhere?

人走茶凉 提交于 2019-12-21 20:21:21
问题 Do you think that running set of automatic tests based on valgrind's tool suite makes sense? Did you hear about or see such setup in action? What automatic (free from human intuition) actions could such setup perform? 回答1: This would make sense if you were checking for memory problems / bad code as part of unit testing or final build testing. There may be two approaches: writing a test tool that will use valgrind's API through its library, pretty much creating a custom front-end replacing the

Visual Studio 2010 Code Analysis - Run on Solution

折月煮酒 提交于 2019-12-21 07:06:07
问题 I would like to manually run code analysis for an entire solution, not on building the project, and not using FXCop, if possible. I did enable CA on build but it really, really slowed down the build process, and we can't have that. But it seems weird to me that code analysis can only be run per project manually through the menus, but not for an entire project. Am I missing something? Thanks. 回答1: I also don't know of a menu/command that can be used to run CA for all projects, but you can

Tool for source code analysis? [closed]

喜欢而已 提交于 2019-12-21 03:17:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Source code analysis and exploration tools for C and C++ seem to be sorely lacking. Are there any tools which I can use to gather information about C and/or C++ source files? cscope does part of what I would need, Doxygen looks closer. At a minimum list of all function, callers, callees, variable references etc.

Matlab: how to find functions on path that use a given function

岁酱吖の 提交于 2019-12-20 20:27:17
问题 It sometimes happens that I need to change the behavior of a function. Is there an easy way to find functions (on the matlab path) that use that function? 回答1: The way I do this is to look for files that contain the name of the function I'm interested in. Thus, I don't only see who calls my function, but also what signature they use. In the editor: Edit->Find Files 回答2: Start with help deprpt . EDIT: when I run a dependency report there are 3 checkboxes at the top of the report window. One of

Generate Call-Tree from cscope database

亡梦爱人 提交于 2019-12-20 18:32:03
问题 I want to generate Full and Partially Call Trees from cscope database of c and c++ projects in Linux. The project is rather large, so it can be not easy to work with the full call tree of project, so I want to limit call tree generation with grep-like filter of function names. And also I want to be able to build "called by" and "called from" sub-trees from any point. So tool must be interactive and easy to patch. PS: I want use cscope database, because it is already used in project and

Any tools to check for duplicate VB.NET code?

谁都会走 提交于 2019-12-20 18:26:10
问题 I wish to get a quick feeling for how much “copy and paste” coding we have, there are many tools for C# / Java to check for this type of thing. Are there any such tools that work well with VB.NET? (I have seen what looks like lots of repeated code, but wish to get some number to help me make a case for sorting it out) Update on progress. I have just tried Simian. It does not seem to be able to produce a nicely formatted report I can sent by email It does not cope when the names of local

generic code duplication detection tool

久未见 提交于 2019-12-20 17:16:09
问题 I'm looking for a code duplication tool that is language agnostic. It's easy to find language specific code duplication tools (for Java, C, PHP, ...), but I'd like to run some code duplication analysis on a templates in a custom syntax. I don't care about advanced parsing of the syntax, just straight line based raw string comparison is fine. Whitespace insensitive matching would be a plus, but not required. (It's not that hard to normalize/eliminate whitespace myself.) Does anybody know a

Code Analysis CA1063 fires when deriving from IDisposable and providing implementation in base class

和自甴很熟 提交于 2019-12-20 16:10:30
问题 I have some code that will trigger Code Analysis warning CA1063: CA1063 : Microsoft.Design : Remove IDisposable from the list of interfaces implemented by 'Functionality' and override the base class Dispose implementation instead. However, I'm not sure what I need to do to fix this warning. Briefly, I have an interface IFunctionality that derives from IDisposable . Class Functionality implements IFunctionality but derives from class Reusable to be able to reuse som code. Class Reusable also