Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Adding a checker to codan


Hello.

First of all, I'd like to congratulate you and your team for the great work
you've done on CDT and Codan so far.

Since a few days, I'm working on CODAN and a few checkers for C-programming, and now I need your help to finish the work I begun. Indeed, before publishing a bug and all the stuff, I'd like to test my work in real conditions.
My first problem is that I can't launch the JUnit suit from my eclipse
workbench. Do I have to include the source in a java project or in a
Eclipse-plugin project?
My second problem is that I did'nt achieved in making my checker visible in
my Eclipse tests workbench., althought I followed all your instructions:
    ? Define a problem --> Done
    ? Pick a model that can be used to find a problem, i.e. Index, AST,
Control Flow Graph, Data Flow Graph, Call Graph --> Took AST to count number
of instructions (1)
    ? Extend abstract checker that supports a given model, and implement a
check (currently supported: No Model, Indexer, C/C++ AST, Control Flow
Graph) --> Extends AbstractIndexIASTChecker (2)
    ? Create extension to define your checker and problem(s) it can find,
define a new category or assign to existing one --> Modified the plugin.xml
    ? Create a quick fix for the problem (optional) --> Don't want to do it
for now
    ? Create a documentation/description of a problem and integration into
extension n--> Modified the .properties
    ? Creation extension to problem view (optional) --> Don't understand
    ? Create a junit test cases --> Done (3)

(1) I'm not sure of what you mean here, is that the same that (2)

(2) I think the head of my file is correct:

package org.eclipse.cdt.codan.internal.checkers;


import org.eclipse.cdt.codan.core.cxx.model.AbstractIndexAstChecker;
import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTExpression;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;

public class NumberOfLinesChecker extends AbstractIndexAstChecker{

       private static final String ER_ID =
"org.eclipse.cdt.codan.checkers.NumberOfLinesProblem"; //$NON-NLS-1$

(3) Got this problem with project's type, Eclipse tells me that my workspace
is closed, althought my MANIFEST is well established

In advance, thank your for giving me a little time, I hope it will be a good
investment, because I got lots of checkers in mind =)

As a conclusion, may I suggest you something: it is a pain to dowload and
create an eclipse project from each folder from the CVS (my proxy doesn't
want CVS access), and once it's done, it took me half a day to create a
build path corresponding to the project's requierement. My advice is that
you distribute the HEAD revision in a tar.gz format, so as to include all
the necessary jars and the sources.

Thanks for reading me, waiting for your answers =)

Regards, Maxime Dechatre.



Back to the top