I am using eclipse based development IDE called STM32Cube IDE V1.5.1. I have installed PMD plugin into same. PMD Plugin version 4.24.x & PMD Version 6.35.x.
On most of the links it was found that PMD can be used for java projects for code analysis however I could not find any information whether it can be used for C++ project or not.
If it can be used for C++ project can anyone direct me to the link.
or can anyone pass on the information on how to configure PMD tool for code analysis for C++ project.
Best Regards,
Satish
PMD doesn't support C++ (or C) for static code analysis. You can only search for duplicated code (the tool "CPD") which is also included in PMD.
CPD: https://pmd.github.io/latest/pmd_userdocs_cpd.html
This tool can be run from within eclipse (with the Eclipse PMD Plugin installed) via the menu "Find suspect cut and paste...".
For the full supported languages of PMD see https://pmd.github.io/latest/pmd_userdocs_cli_reference.html#supported-languages
Related
I have searched for a while on this and have not found a good answer for it. (I am currently talking with GHS Support about this but wanted to post here to see if anyone had any experience with this. I will post an update after talking more with GHS.)
I am developing an embedded application using the Green Hills Software MULTI IDE and compiler. This is a C++ project. I am trying to port an existing .gpj project for use in Eclipse so I can take advantage of the development tools in Eclipse CDT. Has anyone had any experience doing this and could provide tips on it?
I of course want to develop in Eclipse and still compile with the GHS compiler with all of the options in my current .gpj file. Currently I have just had both applications open and have been developing the source in a separate Eclipse project and then compiling in the MULTI project manager with my current .gpj project.
This is discussed briefly here but no solutions are provided:
https://www.eclipse.org/forums/index.php/t/210115/
EDIT: I am open to any suggestions for using modern editors in the MULTI Project Manager (it doesn't have to be the Eclipse CDT). The main development tools needed are autocomplete of existing variables and going to the definition of classes and variables.
The solution that worked best for our group was to create Eclipse C++ projects that mimicked the settings in the .gpj project. To do this the source files were imported, the include paths set, the pre-processor directives were defined, and then the index was built. This way we could develop in Eclipse with all of the great tools it has. We also set up a Build Target to use the MULTI compiler and build the .gpj project through gbuild and have output in the Eclipse console. (see the figure below)
I talked with a support engineer at GHS and he did not recommend using the plug-in for Eclipse to integrate their compiler into Eclipse (our development has used many .gpj projects and we wanted to keep building our projects from the settings in the .gpj projects). He also did not recommend using gbuild to convert the .gpj into a makefile (he said the conversion is not always the best).
There are ways to change the default text editor in MULTI to something like Sublime Text, but creating an Eclipse project from the settings in our .gpj project has worked the best for us. We have done this process manually, and of course it could be automated with enough time.
Although it is theoretically possible to integrate an external static analyzer into Eclipse as demonstrated here (i.e. for Cppcheck), I was wondering whether a more up to date solution exists which does not require plug-in development? For example an existing plug-in, an available option in CODAN or a simplified version of the above tutorial for Clang Static Analyzer specifically.
CodeCheckerEclipsePlugin is an Eclipse plugin that shows Clang Static Analyzer and Clang Tidy defects for your C/C++ projects.
After installation you can add it to your CDT project as "CodeChecker nature". The only software requirement is that you must have Clang and CodeChecker tools installed on your machine. You will need to set up your project so it builds from from Eclipse CDT. Clang static analyzer will be called automatically on your code whenever you build your project in eclipse.
The plugin will call the CodeChecker tool in the background which in turn calls the analysis engines (tidy and static-analyzer) on your build.
As an extention to ClangSA, you may also suppress false positives by using codechecker_suppress code comments like: // codechecker_suppress [deadcode.DeadStores] suppress deadcode
The plugin is hosted on github, see https://github.com/Ericsson/CodeCheckerEclipsePlugin
No. But possible? Yes. All it takes is volunteers to make it happen.
You can take a look at Artemis plugin. Open source project with real-time check based on CODAN framework and quickfix support.
I am looking for a C++ IDE, typically for debugging purpose. In particular, where I can navigate in source code; say method definition, member declaration etc.
I am a Java developer and use Eclipse. I create J2ME project in Eclipse, build it and finally deploy it at same place. At the time of debugging I can easily trace out what I am looking for.
For C/C++ support I installed plug-in "Eclipse C/C++ Development Tools".
After installing above plug-in, C/C++ code open with font/style/color...but not able to navigate :(
Please help me.
Thanks,
Amit
the cdt plugin from eclipse works fine for me. Perhaps you should update to the latest version and make sure you change your perspective to c++.
Another great c++ ide is qtcreator.
I've been reading quite a bit about Thrift and it looks like a technology I'd really like to use. I'm having all sorts of trouble building the Windows distribution. I know a patch exists to build a Windows version, however I have not had much luck with this either.
Does anyone know of a pre-built distribution for Windows?
Or any suggestions on how to get the latest version of Thrift built (without turning my Windows machine into a pseudo *nix box).
Thanks
Rich
Thrift 0.8 now has VS projects for both the compiler and C++ library. Get the snapshot release or the latest off of SVN
http://thrift.apache.org/download/
Edit: 0.8 has been officially released and the source is available as a tarball on the download page.
Edit2: The SVN trunk now has a cross-platform sample project under thrift/contrib/transport-sample
I ported the client part of Thrift to Windows C++ for my own open-source project. It should be easily usable in other Win32 or WinCE projects.
http://peoplesnote.codeplex.com - src\Evernote API\Thrift
Yes there is, just download the exe from here:
http://thrift.apache.org/download/
exe listed for download there is standalone executable, no installation is needed.
I have used it to generate Smalltalk code, did not test other languages.
I'm figuring out that there's two ways of writing C++ in Eclipse: either download the Eclipse IDE for C/C++ Developers or download the regular Eclipse for java and add the CDT plugin. What is the difference between these two? (Note that I'm already exstensively using Eclipse for Java) Thank you
The C++ tools end up the same so depends if you use Eclipse for other things.
If for other things then I would start with the more complex setup e.g. if you do Java J2EE I would download the Eclipse J2EE then add the C++ tools
If just C++ start with the Eclipse C++
I also found using the Yoxos/Eclipse Source packaging easier to download extra packages. (unless you need the absolute latest patch)
edit:
Sorry I did not read the question fully I have given the general answer. However as you have eclipse working and setup already and if you are happy then just download the C++ plugins. Note I have a separate workspace for java and C++ helps as you will want different perpecives etc and also cuts down on the projects in the explore rs/
Or use EasyEclipse for C/C++ and get a few other useful tools pre-integrated too.