Wrong HTML report when using -i option in cppcheck - html

I work for a middleware company. We would like to integrate Cppcheck into our build system to help preventing errors and issues in our code. Our code is big, and it's distributed in several modules (each module in a different folder). These modules have many dependencies between them.
When running cppcheck, we want to run it only once over the whole code to give the whole view to the tool. However, some modules are not related to the core ones, and we want to skip those modules from the analysis. Besides, we have implemented APIs for different languages. So for example, we have some modules for C++ that we would like to analyze separately from the C modules.
We have basically two options: 1) call cppcheck with a list of the modules that we want to analyze, or 2) call cppcheck from the top level folder of the code, and use -i options to ignore all the modules that shouldn't be analyzed.
Both approaches worked fine up to the point of creating the XML report. The problem appears when calling cppcheck-htmlreport. We observed that no index.html or stats.html were generated. Besides, only some of the results appearing in the XML were translated into HTML reports. For many results, the HTML pages were not generated.
Any memory problem can be discarded. We already verified this. Besides, the tool doesn't start creating HTML reports from the XML results consecutively and then it stops. Actually, what happens is that the HTML reports go jumping. I mean, the HTML report for error number 1 in the XML is created, then maybe next one is number 5, and so on.
We called cppcheck-htmlreport with --source-code option pointing to the top level folder of the code. I think the problem may be caused by this. I tried to call cppcheck just from the top level folder, with no -i options, and then the HTML reports were generated without issues. So it looks like the XML created by using -i options cannot be correctly understood by cppcheck-htmlreport.
Is there a way to provide -i options to cppcheck-htmlreport as well? I think this could solve the problem...
I have also noticed that the problem only seems to appear when many modules and code is analyzed. When analyzing only a few modules the HTML report was correct, although we still called cppcheck-htmlreport providing the top level folder as ---source-dir.
Is this a known issue in cppcheck HTML generator? Is there any way to solve this?
Any advice is very much appreciated.
Thanks,
Sonia

Related

How can I have multiple views of the same file in MonoDevelop?

MonoDevelop is supposed to have a split view since version 2.0 but I cannot find it.
Some other posts say it's not in the menu but a keyboard shortcut can be assigned to it. However searching both split and unsplit show nothing in the search result. Comments later say it was buggy.
I'm using MonoDevelop 5.10 on Ubuntu.
Is this feature removed, because no one used it? Or something?
I think you are referring to View >> Editor columns >> Two columns. Yep, it should be called split view.
However, this is not valid in order to have multiple views of the same file. The only way I've found this to work is to open two MonoDevelop instances, make them open the same solution and file, and put them side by side.

Trace Flash Builder compiling commands

is there a way to trace the compiler command for flash builder? I mean, I want to know the parameters and files that is compiling internally when I click "build" on FB.
Basically I moved a project to Flash Builder, and everything works fine but I have some runtime issues, and looks like the compiler is doing something wrong with some files (like using old files instead of using the one im changing, this occur only for a particular file, the rest works fine or I think that works fine). Also is different the way to embed some file, that's another reason to check what's doing internally.
I ran the game with mxmlc before, and probably I can compare what's the difference if I get the command executed by FB.
Also, I want to know how to do it if I need to research something in future.
Thanks for any help,
Regards
Flash Builder only recompiles if there has been a change to the code. So if you are changing an asset (image), for example, you won't recompile unless you also make a change to the project.
There are a few ways around this:
Easiest way is to just go into a file and press the space bar at the end of a line. It will add an extra byte to your file, but not to the project (compiler is "smart" and gets rid of unused files, classes, and characters). Since this is not a common thing, it shouldn't be an issue
Project->Clean.... That will force your workspace to rebuild and, in most cases, will also recompile your project
If #2 is failing, first delete bin-debug or whatever you are using as your debug folder, then run Project->Clean...
It's a tad bit annoying (especially when editing external libraries), but it allows for quicker re-launches of the debugger, which is the ultimate goal of that behavior.

Objective-C - Parsing a .csv, extracting and inserting information, then displaying the .csv as an interface for editing

This question has been troubling me for the past week. Below, I will list my issue, and the research I have put into it.
The scenario: I was given a .csv file with 5000 rows and three columns. The three columns are defined as:
Site ID|Site Name|Site URL
My task: To create an HTML interface for the designers of the company to rate each site on a scale of 1-5.
My plan of action: I am a new hire. I am getting accustomed to the language I was hired for, which was Objective-C.
My algorithm for the project was to:
Parse the .csv
Remove the "Site Name" variable
Create a new .csv that contains the below variables: Site ID|Site URL|Rating|Image
Display the new .csv (with all aforementioned items) as an HTML page where there are toggles for "Ratings", which when pressed, will log the rating into the .csv which it was imported (or loaded) from.
The "Image" section I will be using a piece of software by the name of Paparazzi (on the Mac OS X operating system) which takes a fully formatted screenshot of the main page and saves it as a PNG file. I plan on using the file extension URL (which is stored locally) and load it into the "Image" column, thus when the designer clicks on the image, he is able to load the image that is stored locally.
My issue: As Objective-C is not entirely a scripting language, I am confused with some of the libraries I may need and/or methods I can implement this. I have the algorithm, but I am wholy unsure with the implementation.
My questions: If you have done a project similar to this before with Objective-C, what tips can you provide for me? How does one load the .csv as a HTML interface where upon edit, it will save this edit into the .csv? Will I need any servers for this, or is everything executable from just a machine? How do you grab an image (stored locally), extract its file extension, and load it onto the .csv?
The most important question: Is this achievable through Objective-C? My reasoning behind it is, I want to advance my knowledge of OC through a task like this. Yes, using Python is easier, but is it possible to do this with Objective-C?
Thank you.
It certainly is achievable, but I doubt you'd really want to go this way. If I understand it correctly, you want to serve the HTML page to others via web browser - that would mean either writing a (simple) http daemon, that would run on the server or writing a CGI script that would communicate with a standard http daemon. Python/PHP/Ruby do this for you readily, so there is much less room for possible errors.
As for
As Objective-C is not entirely a scripting language
I would perhaps rephrase it as
As Objective-C is entirely not a scripting language

How does one make a self-contained package / library of functions

I am writing some support code in the common subset of Matlab/Octave, which comes in the form of a bunch of functions. Let's call it a package.
I want to be able to organize the package, i.e.,
put all the relevant function files in a single place, where users
are not supposed to store their code;
have some internal organization ('subpackages');
prevent namespace pollution;
have some mechanism for user code to 'import' parts of the package;
I don't necessarily want all functions I provide to be
visible from user clients.
On the Matlab side of things, this functionality is pretty much provided by package directories and the 'import' mechanism. This functionality doesn't appear to be available in Octave though (as of 3.6.1).
Given that, I wonder what options remain for organizing my support code package in Octave.
The option of putting everything in a directory and just have the user code do an ADDPATH feels rather unrefined, and doesn't give the level of control I want -- it only addresses point #1 of the list above.
There is plenty documentation here and examples in OctaveForge. Just browse the SVN.
Also there are personal packages all around. For example this one
Happy coding!

How can I easily save the HTML pages of my Rails app, to give to Designer?

I am working on a Rails app, and a designer is designing the raw HTML pages separately. Its tough to get his environment set up to use the application directly, so I would like to be able to somehow "store" the HTML of all of the pages that my application generates, to a directory somewhere to that I can pass the curent version off to the designer.
Does anyone know of a gem or rake task that would help me do something likee this?
I am also open to other suggestions for working in parallel with designers who don't know rails.
Thanks
Edit
I guess an amendment to my question, would be, does anyone also know of ways of generating the list of page links to feed to wget, other than going through them by hand
Edit 2
Just thinking out loud... to generate every possible page in an app, you'd need to call every action in every controller. So i'd need a program to find which controllers exist in all of my app/gems/plugins, and then find all of the public methods in them.. Or.. maybe I could just use the actions that are routable from the list of routes
Then, you might want to filter out the actions that didn't render html
Then you might want to filter out destructive actions (unless this program ran in a test environment, and rebuilt the system every time).
Then as many actions depend on the parameters that are supplied, you'd need to have control over which parameters are sent to each action...
Then you'd also have to be able to send session cookies to log in
what else..
wget -m http://somewhere.com
This command will fetch all the files / pages from http://somewhere.com and download them to a local directory, to form a local "mirror."
-m
--mirror
Turn on options suitable for mirroring. This option turns
on recursion and time-stamping, sets infinite recursion depth and
keeps FTP directory listings. It is currently equivalent to -r -N -l
inf --no-remove-listing.
Note: I don't believe Mac OS X ships with wget. If you are using a Mac, I'd suggest installing Homebrew and then running brew install wget.
Read more: man wget