添加 sonar

This commit is contained in:
cheney 2022-09-01 16:18:33 +08:00
parent 40bb130ffc
commit 2e6de7a7c4
5 changed files with 32 additions and 4 deletions

11
pom.xml
View File

@ -45,7 +45,15 @@
</dependencies>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.3.0.603</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@ -57,4 +65,5 @@
</plugin>
</plugins>
</build>
</project>

4
sonar.cmd Normal file
View File

@ -0,0 +1,4 @@
mvn sonar:sonar ^
-Dsonar.projectKey=sydapi-sge-datebase ^
-Dsonar.host.url=http://172.16.17.236:9000 ^
-Dsonar.login=3f3a85127ef9636cf37a39d8fbfe823b7e952481

View File

@ -126,7 +126,10 @@ public class SydApiSM4 {
return api.SYD_SM4_LongData(iKeyIndex, pcdataResult, iPkgNum, iFlag);
} else {
if (16 > pcData.length + sourceWrap.array().length||(pcData.length + sourceWrap.array().length)/16<2) {
if (16 > pcData.length + sourceWrap.array().length
||
(pcData.length + sourceWrap.array().length)/16<2
) {
ByteBuffer bufferResult = ByteBuffer.allocate(sourceWrap.array().length + plength);
bufferResult.put(sourceWrap.array());
bufferResult.put(pcData);

View File

@ -21,7 +21,7 @@ public class LengthTest
@Before
public void init(){
SydApiBuilder builder = new SydApiBuilder(
new String[]{ "192.168.0.200" },
new String[]{ "192.168.1.128" },
new int[]{ 8889 },
10,
15

View File

@ -1,4 +1,4 @@
//package test;
package test;
//
//import com.sunyard.sge.database.*;
//import org.junit.Test;
@ -90,3 +90,15 @@
//// }
// }
//}
public class Test {
public static void main(String[] args) {
if (16 > 1799 + 16
||
(1799 + 16)/16<2
) {
System.out.println("1");
}
}
}