I'm trying to analyze the code of a vb application in TFS.
I'm using SonarQube, with the TFS extension.
My issue is that, whenever SonarQube encounters a file which only has comments in it, it will fail with this message :
ERROR: Error during SonarQube Scanner execution
ERROR: Unable to register token in file the [filepath].vb
ERROR: Caused by: 21 is not a valid line offset for pointer. File [filepath].vb has 20 character(s) at line 1
All the files have the .vb extension.
I would just remove these useless files from the repository but the code is not mine and there are over 15K files.
Is there a way to avoid crashing on this type of files ?
Or avoid analysing files filled with comments and empty lines ?
Related
I'm getting an error, "Could not copy the file [file name in app folder] because it was not found." This is giving me a build error, not a runtime error. There is no path or file given. I am using filecopy commands, but not even on the main form. I have searched the entire solution for "FileCopy," and the only 2 are in a form not yet loaded, within a try-catch-end try. How can I find the source of this error?
SonarQube: 5.2
Scanner For MSBuild: 1.0.2
Below line exists in FilesToAnalyze.txt deep inside .sonarqube folder
...Help\User\Duplicating,_Renaming,_Deleting_a_Blueprint.htm
And, MSBuild.SonarQube.Runner.exe end throws below exception. Notice how file name is truncated just before first comma in file name.
Caused by: java.lang.IllegalStateException: The folder 'C:\<full\path>\Help\User\Duplicating' does not exist for '<sonar:key>:509A1B17-E264-4DF5-99FC-AF27D064FBC4' (base directory = <dir containing .sonarqube>)
I decided to exclude the folder containing Help\User\ by passing /d:sonar.exclusions="**\<parentDir>\Help\**". This has no effect.
Is there an issue in Sonar Runner if file names contained comma?
Why doesn't sonar.exclusions have any effect?
Finally, log message states ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging. How do I pass -X switch to Sonar Runner from MSBuild.SonarQube.Runner.exe. Is it in the begin command or end command?
This is indeed a known issue.
Please refer to https://jira.sonarsource.com/browse/SONARMSBRU-199 for details as to when it will be fixed.
I download visual studio code for mac today. I tried to create a simple asp.net 5 web application following these instructions https://code.visualstudio.com/Docs/ASPnet5
When I open my web application folder in visual studio, it says I need to run a restore command.
I ran the dnu restore command just like the instructions tell me but it seems to always fail.
I receive different errors every time I run it. But most of them are like this one:
CACHE https://www.nuget.org/api/v2/package/System.Threading/4.0.10-beta-22816
SharpCompress.Common.ArchiveException: Could not find Zip file Directory at the end of the file. File may be corrupted.
Restore failed
There is a stack trace as well, but for brevity sake I'll omit it for now
Has anyone experienced this?
Try dnu restore --no-cache.
You may also need to remove previously downloaded files - check ~/.dnx/packages. I removed all files from that folder some time before trying the above. Also, see the comments below, if ~/.dnx/runtimes contains unexpected versions removing them may also work. Note that the current runtime version can be controlled using dnvm.
I never saw the NullReference exception, but I was getting the SharpCompress.Common.ArchiveException. I suspect there was a mismatch from what dnu thought was the cache state with the actual cache state (maybe something timed out the first time or something).
I'm moving a website to a new domain and server and I'm running into some problems. This website works with Smarty, and I've never used it before. I think I got a very basic problem, but I can't find the answer online.
I've moved all the FTP files to the new server
I've copied the database
I've edited the config file with the new database information
Now only EVERY page (even a blank test.php file with a simple echo) I get "failed to open stream" errors.
Warning: rename(/home/*websitename*/domains/*websitename*.com/public_html//skins/default/compiled/65e3d4d7349f9687ce73f56b61992749304409a2.file.index.tpl.php) [function.rename]: failed to open stream: Permission denied in /home/*websitename*/domains/*websitename*.com/public_html/external/smarty/sysplugins/smarty_internal_write_file.php on line 48
Warning: rename(/tmp/wrtPBIHNP,/home/*websitename*/domains/*websitename*.com/public_html//skins/default/compiled/65e3d4d7349f9687ce73f56b61992749304409a2.file.index.tpl.php) [function.rename]: Permission denied in /home/*websitename*/domains/*websitename*.com/public_html/external/smarty/sysplugins/smarty_internal_write_file.php on line 48
Warning: chmod() [function.chmod]: No such file or directory in /home/*websitename*/domains/*websitename*.com/public_html/external/smarty/sysplugins/smarty_internal_write_file.php on line 50
Warning: include(/home/*websitename*/domains/*websitename*.com/public_html//skins/default/compiled/65e3d4d7349f9687ce73f56b61992749304409a2.file.index.tpl.php) [function.include]: failed to open stream: No such file or directory in /home/*websitename*/domains/*websitename*.com/public_html/external/smarty/sysplugins/smarty_internal_template.php on line 432
Warning: include() [function.include]: Failed opening '/home/*websitename*/domains/*websitename*.com/public_html//skins/default/compiled/65e3d4d7349f9687ce73f56b61992749304409a2.file.index.tpl.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/*websitename*/domains/*websitename*.com/public_html/external/smarty/sysplugins/smarty_internal_template.php on line 432
It looks like a problem with premissions, but I've made EVERY file on the FTP premission 777 (to test) and this does not solve it.
There are two backslashes /public_html//skins/ which is weird.
The code is exactly the same on the "old" server, besides the config file. Only thing new is the domain name.
What am I doing wrong?
You should set for directory compiled permissions 755 or 777.
You should probably also remove all compiled and cached files (if you use cache) because it may also cause problems
I have read numerous MSBuild posts, but none seem to refer to a strange problem I am having.
In MSBuild.xml (.NET 3.5) I have the following:
<ItemGroup>
<JavaScriptFiles Include="..\js\jquery.translator-ms-1.0.0-debug-all.js" />
</ItemGroup>
I receive an error:
Error 188 Failed to read in the data for the path/file [..\js\jquery.translator-ms-1.0.0-debug-all.js]. The most common cause for this is because the path is incorrect or the file name is incorrect ... so please check your path and file names.
However, if I use a file in the very same folder as follows with like properties:
The build completes successfully.
Does anyone know the "uncommon" causes for this error?
Possible reasons for being unable to open and/or read a file:
It doesn't exist.
It is open in another process (either for exclusive access, or it's locked).
You don't have NTFS permissions.
You want write access but the file has the read-only attribute.
The combined length of the path and (your quite long) filename exceeds MAX_PATH (260) characters.
The file is on a remote server and there's a network problem.
You've run out of kernel resources (e.g. too many files or handles in general open). This is quite unlikely.
You have a physical disk error.
It turns out that having the "debugger" statement within this JavaScript file was the "uncommon" error in this case.