Specifying Source Directories - Does SQ Go To Sub-Directories Automatically?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Specifying Source Directories - Does SQ Go To Sub-Directories Automatically?

Kyle Smith
Hello SonarQube Users,

I have a huge amount of source-code to scan. There are numerous directories below a higher directory. Please, see Figure 1 below.  In this example each of these sub-directories contains source-code.
 
a
|_b
   |_c
      |_d

Figure 1: Example directory structure.

My Question is do I need to a) make a sonar.modules for each sub-directory and put that sub-directory folder in the sonar.projectBaseDir field, b) specify each sub-directory in the sonar.sources field, c) simply put "the dot" for the current directory for sonar.sources or d) can I simply specify the top directory and then specify "the dot" for the sources instead?

I am confused as to whether sonar-runner will drop into b, c, and d directories if for example the properties file looks like so. 

sonar.projectBaseDir=a
sonar.sources=.


TL:DR - Does sonar-runner drop into lower directories when the sonar.sources field is set to the dot or a folder with sub-directories under it ?

Regards,

Reply | Threaded
Open this post in threaded view
|

Re: Specifying Source Directories - Does SQ Go To Sub-Directories Automatically?

G. Ann Campbell
First, you probably don't need to set sonar.projectBaseDir at all.

Simply put your sonar-project.properties file into your project root, cd into that directory and kick off analysis.

Yes, Sonar Runner will recurse into subdirectories starting from your designated sonar.sources directory.

There are differences in the ways that modules and subdirectories are treated, but I've never thought much about it, so it's difficult for me to enumerate what they are. Setting up modules can be a pain, so I would start with a simple analysis and see if you like the results.


HTH
Ann


On Wed, Jul 30, 2014 at 2:19 PM, What_Just_Happened <[hidden email]> wrote:
Hello SonarQube Users,

I have a huge amount of source-code to scan. There are numerous directories
below a higher directory. Please, see Figure 1 below.  In this example each
of these sub-directories contains source-code.

a
|_b
   |_c
      |_d

Figure 1: Example directory structure.

My Question is do I need to a) make a sonar.modules for each sub-directory
and put that sub-directory folder in the sonar.projectBaseDir field, b)
specify each sub-directory in the sonar.sources field, c) simply put "the
dot" for the current directory for sonar.sources or d) can I simply specify
the top directory and then specify "the dot" for the sources instead?

*I am confused as to whether /sonar-runner/ will drop into b, c, and d
directories if for example the properties file looks like so.*

/sonar.projectBaseDir=a
sonar.sources=. /

*TL:DR* - Does sonar-runner drop into lower directories when the
sonar.sources field is set to the dot or a folder with sub-directories under
it ?

Regards,





--
View this message in context: http://sonarqube.15.x6.nabble.com/Specifying-Source-Directories-Does-SQ-Go-To-Sub-Directories-Automatically-tp5026994.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
G. Ann CAMPBELL | SonarSource
Reply | Threaded
Open this post in threaded view
|

Re: Specifying Source Directories - Does SQ Go To Sub-Directories Automatically?

Kyle Smith
Hi Ann,

Thank-you for the reply.  I try specifying the top-level directory without any modules but I receive an EXECUTION FAILURE, a database error, and it takes about 3 hours to run.

Here is one error I receive when attempting this:


ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Error while commiting the transaction
ERROR: Caused by: Cannot release connection
ERROR: Caused by: Already closed.


Is there some type of upper-limit on lines of code (LOC) that should be considered before running a scan without any modules? Is there no limits on LOC if there is sufficient RAM and CPU power?

Thank-you for reading this.

Regards,