Feat: add static analytic of code

This commit is contained in:
Laurent Clouet
2024-06-03 14:02:30 +00:00
parent c966a1a032
commit 4bce6409e3
52 changed files with 249 additions and 316 deletions

View File

@@ -103,7 +103,7 @@ import java.util.regex.Pattern;
archiveChunks = archiveChunks_;
rendererMD5 = rendererMd5_;
name = name_;
password = password_;
password = password_.clone();
synchronousUpload = synchronous_upload_;
gui = gui_;
outputImagePath = null;
@@ -344,8 +344,7 @@ import java.util.regex.Pattern;
getProcessRender().setOsProcess(OS.operatingSystem.getProcess((int) getProcessRender().getProcess().pid()));
BufferedReader input = new BufferedReader(new InputStreamReader(getProcessRender().getProcess().getInputStream()));
memoryCheck.scheduleAtFixedRate(new TimerTask() {
@Override
public void run() {
@Override public void run() {
updateProcess();
}
}, 0L, 200L);
@@ -464,7 +463,7 @@ import java.util.regex.Pattern;
return Error.Type.RENDERER_OUT_OF_MEMORY;
}
updateSpeedSamplesRendered(line, progress);
updateSpeedSamplesRendered(line);
updateRenderingStatus(line, progress);
Type error = detectError(line);
if (error != Error.Type.OK) {
@@ -681,7 +680,7 @@ import java.util.regex.Pattern;
return newProgress;
}
private void updateSpeedSamplesRendered(String line, int progress) {
private void updateSpeedSamplesRendered(String line) {
// Looking for "Rendered 1281 samples in 66.319402 seconds"
Pattern pattern = Pattern.compile("^Rendered (\\d+) samples in ([\\d.]+) seconds$");
Matcher matcher = pattern.matcher(line);