Thursday, February 08, 2018

Analysing the code using SonarQube Scanner

Step 1:- Download the O/S Specific version from below site
https://docs.sonarqube.org/display/SCAN/Analyzing+with+SonarQube+Scanner
Iamge1
Step:-2 Modify sonar-scanner.properties for configuring new project
C:\sonar-scanner-3.0.3.778-windows\conf\sonar-scanner.properties
#Configure here general information about the environment, such as SonarQube DB details for example
#No information about specific project should appear here
#----- Default SonarQube server
sonar.host.url=http://localhost:9000
#----- Default source code encoding
#sonar.sourceEncoding=UTF-8
sonar.projectName=TestSiddhuGWT
sonar.projectVersion=1.0
sonar.sources=C:/GWT-Workspace/rest-api-sample
sonar.projectKey=TestSiddhuGWT
Step 3:- Execute the scanner with below given command in another cmd prompt
C:\sonar-scanner-3.0.3.778-windows\bin>sonar-scanner.bat
Iamge2
And see the resultant information on the screen
Iamge3

Soap Call Using ReactJS


First the user click on button having register onClick method onClick={this.callWebservice}

Once user click on the button we make a simple Ajax SOAP call using xmlHttpRequest and onsucess we dispaly the data on pop up window.



Addition of Two value using ReactJS

First the user enter the value in the number1 and number2 are the textfield and we had written onChange event on this text field
onChange={(event)=>this.setState({number1:event.target.value})}
onChange={(event)=>this.setState({number2:event.target.value})}
Second the user click on the button and code onClick={this.doAction} is executed.
doAction()
{
this.setState({result : parseInt(this.state.number1) + parseInt(this.state.number2) });
}
Note: Before using any variable we have to declare it inside constructor. We also need to register the action method using this object