Cppcheck GUI: Excluding a file or folder from checking - configuration-files

I am using Cppcheck GUI to scan my projects (new in Cppcheck, just starded to use it) and want to exclude some sub folders when I am scanning my project.
How to exclude some sub folder when scanning project folder with cppcheck GUI?
I have watched some videos on YouTube and tried to exclude as shown in this video but it still scanning excluded sub folders.
Thanks in advance.

Excluding a file or folder from checking
To exclude a file or folder, there are two options. The first option is to only provide the paths and files
you want to check.
cppcheck src/a src/b
All files under src/a and src/b are then checked.
The second option is to use -i, with it you specify files/paths to ignore. With this command no files in
src/c are checked:
cppcheck -isrc/c src
ref : http://cppcheck.sourceforge.net/manual.pdf

As of version 1.80, the manual still misses to describe the structure of GUI project files (chapter 12). The GUI itself has a lot of flaws, so I consider editing the project file through the GUI a waste of time. On the other hand, having these project files (under version control) and editing them by hand proved to be useful.
Here is the structure of a minimal project:
<?xml version="1.0" encoding="UTF-8"?>
<project version="1"/>
With such a file, Cppcheck is run on all potential C/C++ source files in the directory the cppcheck project file resides in (recursively including subfolders). You may exclude files or paths like this:
<?xml version="1.0" encoding="UTF-8"?>
<project version="1">
<exclude>
<path name="utilities/fileToExclude.c"/>
<path name="utilities/pathToExclude/"/>
</exclude>
</project>
Note: If you have the project already open in the GUI and edited its project file, remember to re-open the project file, only re-running all checks will not force a refresh of the project settings.

As of cppcheck-gui 1.88, the option to add excluded paths is found on the "Warning Options" tab:

Related

Output Directory of native dll bundled with NuGet

I am trying to build a NuGet package that includes native DLLs which are to be placed in the output folder when a project uses the package. I have tried to use the several suggestions from this question, but I am always running in the same problem.
My current NuGet package layout is like this:
\build
packageId.targets
file1.dll
file2.dll
\lib
\netstandard1.4
assembly.dll
The contents of packageId.targets is:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<NativeLibs Include="$(MSBuildThisFileDirectory)\*.dll"/>
<None Include="#(NativeLibs)" Link="$(RecursiveDir)$(Filename)$(Extension)">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
This should, according to the answers of the other questions, lead to my DLLs being placed in the bin\Debug directory of the project using the package. However, they are not. Instead, they are placed in bin\Debug\packages\packageId\build.
Now I have experimented a lot, and I noticed more and more strange behavior which I cannot make any sense of:
If I move the DLLs to the root of the NuGet package (like one answer suggests) and change the .targets file accordingly, they are not copied at all. There also is no error message.
If I change the .targets file to only reference file1.dll in both Include= and Link=, both files get copied anyway.
So I wondered if some policy just ignores the .targets file and copies whatever is in build to that path in the output folder, but when I remove the .targets file, the DLL files will not get copied anymore.
Now I understand even less what's happening.
What do I need to change to get the DLLs copied right into bin\Debug?
The new way to handle runtime-specific assents in NuGet is to use the runtimes folder to place native assets:
\lib
\netstandard2.0
ManagedWrapper.dll
\runtimes
\win-x86
\native
NativeThing.dll
\win-x64
\native
NativeThing.dll
\linux-x64
\native
libNativeThing.so
\osx-x64
\native
libNativeThing.dylib
If the package is consumed from a .NET Framework project, you may need to add a reference to the Microsoft.NETCore.Platforms package wich provides the runtime graph (runtimes.json) for NuGet to provide proper RID mappings if you don't use base RIDs (e.g. win10-x64 falls back to win-x64 resources).

How to only include some files on a Eclipse project?

I would like to create an Eclipse project from an existing project made with IAR Workbench.
I have a list of files I want to build, but I don't know how I can tell Eclipse to only include some files only.
I've discovered that I can "exclude" a file by clicking on the file then choosing Resource Configuration/Exclude. I've also found that I can place some filters on Resource Filters, but I have found where I can just include some paths such as
${workspace_loc:/${ProjName}/Foo/Bar/foo.c
How is it possible to do this?
I am going to answer my own question: you can't.
What you can do is to list the files on your Git repository and the files that should be excluded from your Eclipse project. Then you make the difference between both list to get the list of file that are on Eclipse.
Then from the .cproject file you can edit the key
<storageModule>
<!-- ... -->
<configuration>
<!-- ... -->
<sourceEntries>
<entry excluding="{{file}}|{{file}}..."
</sourceEntries>
</configuration>
</storageModule>

Web.config file for the contents and Scripts folder not copied while doing an msbuild to get the build package

I am working on a asp.net mvc2 project which has Contents folder containing images,css files and Scripts folder containing all the js libraries and files used in the project. I have a web.config file containing the code for enabling caching for the contents present within the Contents and Scripts folder as mentioned below:
Web.config:
<?xml version="1.0"?>
<configuration>
<system.webServer>
<!--Caching-->
<staticContent>
<clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="365.00:00:00" cacheControlCustom="must-revalidate"/>
<!--<clientCache cacheControlMode="UseExpires" httpExpires="Tue, 31 Dec 2030 12:00:00 GMT"/>-->
</staticContent>
</system.webServer>
</configuration>
I am using msbuild to get a package ready for deployment. I see the package is built successfully containing the MSI which I install in the server. After installing the MSI I see that there is no web.config present within the Contents and Scripts folder in the server.
I tried setting Copy to Output Directory = Copy Always in the properties section of the web.config file but still I don't see it in the Contents and Scripts folder in the server.
Can anyone help me to fix the issue?
Thanks & Regards,
Santosh Kumar Patro
From your question I assume you are building your MSI with the Visual Studio Web Setup Project. In that case, you also need to make sure your extra web.config files are included in the "File System" tab view of your installer project. Normally those would be part of "Content Files".

How to centralize the CVS server name for an Eclipse project-set (.psf)?

We have users around the world who use the same source code. The location of the CVS repository (in the below sample: cvsserver) differs from one office to another. The project set file we have commited in CVS (for use by all users) looks like:
<?xml version="1.0" encoding="UTF-8"?>
<psf version="2.0">
<provider id="org.eclipse.team.cvs.core.cvsnature">
<project reference="1.0,:pserver:cvsserver:/topdir,Project1,Project1,BRANCH"/>
<project reference="1.0,:pserver:cvsserver:/topdir,Project2,Project2,BRANCH"/>
<project reference="1.0,:pserver:cvsserver:/topdir,Project3,Project3,BRANCH"/>
.... lots of other projects with the same "pserver:cvsserver:/topdir" part
</provider>
... several workingSets
</psf>
Users in the same office as me can checkout from this project-set as-is. But for users in other offices, the cvs server name is not cvsserver... They have to find/replace cvsserver in the .psf file and then they can checkout the projects (using Import-->Team-->Team Project Set in Eclipse).
Is it possible to use a variable or property in Eclipse so that the user will set that variable once and for all and use the .psf file without modifying it?
Or as an alternative, can one declare the CVS server name at the top of the .psf file, so that the user will have to edit just that single declaration in the file?
Thanks in advance for any help, since I can't find that specific information.
I can't see any support for anything like this in the .psf loading code (org.eclipse.team.internal.ui.ProjectSetImporter which uses org.eclipse.team.internal.ccvs.ui.CVSProjectSetSerializer for CVS).

How do you change a NetBeans project type after it has been created?

I created a project from existing sources as a PHP project in an older version of NetBeans.
I now want to change the project type to an HTML5/CSS project in NetBeans 7.4.
Is there any easy way to change the type of an existing project in NetBeans?
I'm trying to avoid creating a new project from existing sources as I have all my server connection variables already configured.
The project data is stored within the main project directory in a subdirectory named nbproject.
The file project.xml contains the main configuration data for the TYPE of the project. The type and data xml namexspace settings determine the basic project type. Here is a PHP version:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>codex-slp</name>
</data>
</configuration>
</project>
Here is an HTML5 project version:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.web.clientproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/clientside-project/1">
<name>csa</name>
</data>
</configuration>
</project>
Note the line is different. The HTML 5 project uses the namespace org.netbeans.modules.web.clientproject. The PHP version is at org.netbeans.modules.php.project.
Also of note is the data xmlns entry with HTML5 pointing to the clientside-project directory while PHP points to the php-project directory.
How to change the project? Not easily. Your best bet:
Close out the NetBeans IDE.
Go to the project directory.
Remove (or rename) the nbproject subdirectory.
Open NetBeans.
Create a new HTML5 project from existing sources.
That will switch the project type from PHP to HTML5 and give you the corresponding dialogue boxes.
The reason I decided to take this approach is there are a lot of other things that hang off this namespace specification. The project.properties file, for example, has very different entries for a PHP project, thinks like the PHP version, that do not exist for the HTML5 project. The HTML5 project has new properties that are not present in PHP projects.
There is also an entire private subdirectory that has a plethora of options set in the private.properties file that contains things like the source remote connection for a PHP project that does not exist nor seem to even be SUPPORTED for an HTML5 project.
There are far too many disparities between the two project types to simply hack up the nbproject directory files and hope it works.
IMO your best option is to follow the steps above to recreate the project.
Sadly, it does not appear as though HTML5 project types have matured to the point of the PHP project types with things like supporting remote pull/push of changed files. For this particular project I've reverted back to the PHP project type even though this is not really a PHP project. I heavily rely upon the automatic remote server push via FTP. How did I restore the project? I renamed my nbproject directory to saved_nbproject, so to revert:
Close Netbeans.
Go to project directory.
Rename my saved_nbproject directory back to nbproject.
Restart NetBeans.
Maybe changing project types AND HTML5 remote server support will be available in the future. For now, with NetBeans 7.4 it does not appear this transition is readily available.
If anyone else has input or other feedback I'd love to hear it as NetBeans has become my go-to tool for complex code projects.
NOTE: I would strongly suggest to create a new project from existing sources to ensure everything will work as expected. In most cases its faster and less problematic.
(If you persist....)
Following the accepted answer may result in an error. Besides what Charleston Software Associates posted, you may need to copy other variables included in "project.properties" file.
For example, these are for PHP: (adjust properly. I suggest to see some of your other projects to prevent mistakes).
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_create_2e_tests=false
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.configuration_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.customSuite_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.test_2e_run_2e_all=false
ignore.path=
include.path=
php.version=PHP_53
source.encoding=UTF-8
src.dir=/var/www/example
tags.asp=false
tags.short=false
web.root=.
These are for HTML5:
auxiliary.org-netbeans-modules-css-prep.less_2e_compiler_2e_options=
auxiliary.org-netbeans-modules-css-prep.less_2e_enabled=false
auxiliary.org-netbeans-modules-css-prep.less_2e_mappings=/less:/css
auxiliary.org-netbeans-modules-css-prep.sass_2e_compiler_2e_options=--style compressed
auxiliary.org-netbeans-modules-css-prep.sass_2e_configured=true
auxiliary.org-netbeans-modules-css-prep.sass_2e_enabled=true
auxiliary.org-netbeans-modules-css-prep.sass_2e_mappings=/scss:/css
auxiliary.org-netbeans-modules-javascript2-requirejs.enabled=true
auxiliary.org-netbeans-modules-web-clientproject-api.js_2e_libs_2e_folder=js
config.folder=${file.reference.example-config}
file.reference.example-config=config
file.reference.example-test=test
file.reference.www-example=/var/www/example
files.encoding=UTF-8
site.root.folder=${file.reference.www-example}
test.folder=${file.reference.example-test}
You can mix both in a single file without any problem.
Using: Netbeans 8.0.1
Try to edit your project.xml replace type with
<type>org.netbeans.modules.web.clientproject</type>
Guys this has changed for version 7.4?
in private.properties
remote.connection=remotename
remote.directory=/public_html/
remote.upload=ON_SAVE
run.as=REMOTE
url=http://remotename.com
I tried changing xml and that didn't work well for me. I fiddled around and found a way that seems simpler to me - just delete and create a new project!
Right click the project in netbeans, and click delete. (make sure to NOT check the box that says delete sources!). That clears out the netbeans project info. Then just make a new project of whatever type you want. Go to File->New Project. Select project type (in this case HTML5 Project with existing sources), making sure to select the one that has "with existing sources". Hit next. Now here is a key part. The site root is your mysite/public_html folder most likely. The project directory is your mysite folder. The netbeans config will be put in the mysite folder.
Then you should be good to go!
Close Netbeans.
Delete nbproject folder inside your app folder. It can be hidden folder , so , in windows, go to folder properties and activate hidden folder.
Reopen Net Beans. Create a new project of the correct type.