Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: address IntelliJ QAPlug plugin findings #75

Merged
merged 3 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,9 @@ public void process() {
lightGeometryMaterial.setInt("texSceneOpaqueNormals", 1, true);
lightGeometryMaterial.setMatrix4("viewProjMatrix", activeCamera.getViewProjectionMatrix());

if (renderingConfig.isDynamicShadows()) {
if (renderingConfig.isCloudShadows()) {
lightGeometryMaterial.setFloat("time", worldProvider.getTime().getDays(), true);
lightGeometryMaterial.setFloat3("cameraPosition", cameraPosition, true);
}
if (renderingConfig.isDynamicShadows() && renderingConfig.isCloudShadows()) {
lightGeometryMaterial.setFloat("time", worldProvider.getTime().getDays(), true);
lightGeometryMaterial.setFloat3("cameraPosition", cameraPosition, true);
}

if (renderingConfig.isDynamicShadows()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
public class FinalPostProcessingNode extends AbstractNode implements PropertyChangeListener {
public static final SimpleUri POST_FBO_URI = new SimpleUri("engine:fbo.finalBuffer");
private static final ResourceUrn POST_MATERIAL_URN = new ResourceUrn("CoreRendering:post");
private static final int noiseTextureSize = 1024;

Check warning on line 56 in src/main/java/org/terasology/corerendering/rendering/dag/nodes/FinalPostProcessingNode.java

View check run for this annotation

Terasology Jenkins.io / CheckStyle

ConstantNameCheck

LOW: Name 'noiseTextureSize' must match pattern '^([A-Z][A-Z0-9]*(_[A-Z0-9]+)*|logger)$'.
Raw output
<p> Checks that constant names conform to a format specified by the format property. A <em>constant</em> is a <strong>static</strong> and <strong>final</strong> field or an interface/annotation field, except <strong>serialVersionUID</strong> and <strong>serialPersistentFields</strong>. </p>

private WorldRenderer worldRenderer;
private RenderingConfig renderingConfig;
Expand All @@ -78,7 +79,6 @@

private Vector3f tint = new Vector3f(.0f, .0f, .0f);

private final int noiseTextureSize = 1024;

public FinalPostProcessingNode(String nodeUri, Name providingModule, Context context) {
super(nodeUri, providingModule, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import org.terasology.engine.entitySystem.systems.RenderSystem;
import org.terasology.engine.monitoring.PerformanceMonitor;
import org.terasology.gestalt.naming.Name;
import org.terasology.engine.rendering.cameras.Camera;

Check warning on line 10 in src/main/java/org/terasology/corerendering/rendering/dag/nodes/SimpleBlendMaterialsNode.java

View check run for this annotation

Terasology Jenkins.io / CheckStyle

UnusedImportsCheck

NORMAL: Unused import - org.terasology.engine.rendering.cameras.Camera.
Raw output
<p>Since Checkstyle 3.0</p><p> Checks for unused import statements. Checkstyle uses a simple but very reliable algorithm to report on unused import statements. An import statement is considered unused if: </p><ul><li> It is not referenced in the file. The algorithm does not support wild-card imports like <code>import java.io.*;</code>. Most IDE's provide very sophisticated checks for imports that handle wild-card imports. </li><li> It is a duplicate of another import. This is when a class is imported more than once. </li><li> The class imported is from the <code>java.lang</code> package. For example importing <code>java.lang.String</code>. </li><li> The class imported is from the same package. </li><li><b>Optionally:</b> it is referenced in Javadoc comments. This check is on by default, but it is considered bad practice to introduce a compile time dependency for documentation purposes only. As an example, the import <code>java.util.Date</code> would be considered referenced with the Javadoc comment <code>{@link Date}</code>. The alternative to avoid introducing a compile time dependency would be to write the Javadoc comment as <code>{@link java.util.Date}</code>. </li></ul><p> The main limitation of this check is handling the case where an imported type has the same name as a declaration, such as a member variable. </p><p> For example, in the following case the import <code>java.awt.Component</code> will not be flagged as unused: </p><pre><code> import java.awt.Component; class FooBar { private Object Component; // a bad practice in my opinion ... } </code></pre>
import org.terasology.engine.rendering.dag.AbstractNode;
import org.terasology.engine.rendering.dag.dependencyConnections.BufferPairConnection;
import org.terasology.engine.rendering.dag.stateChanges.BindFbo;
import org.terasology.engine.rendering.dag.stateChanges.DisableDepthWriting;
import org.terasology.engine.rendering.dag.stateChanges.EnableBlending;
import org.terasology.engine.rendering.dag.stateChanges.SetBlendFunction;
import org.terasology.engine.rendering.world.WorldRenderer;

Check warning on line 17 in src/main/java/org/terasology/corerendering/rendering/dag/nodes/SimpleBlendMaterialsNode.java

View check run for this annotation

Terasology Jenkins.io / CheckStyle

UnusedImportsCheck

NORMAL: Unused import - org.terasology.engine.rendering.world.WorldRenderer.
Raw output
<p>Since Checkstyle 3.0</p><p> Checks for unused import statements. Checkstyle uses a simple but very reliable algorithm to report on unused import statements. An import statement is considered unused if: </p><ul><li> It is not referenced in the file. The algorithm does not support wild-card imports like <code>import java.io.*;</code>. Most IDE's provide very sophisticated checks for imports that handle wild-card imports. </li><li> It is a duplicate of another import. This is when a class is imported more than once. </li><li> The class imported is from the <code>java.lang</code> package. For example importing <code>java.lang.String</code>. </li><li> The class imported is from the same package. </li><li><b>Optionally:</b> it is referenced in Javadoc comments. This check is on by default, but it is considered bad practice to introduce a compile time dependency for documentation purposes only. As an example, the import <code>java.util.Date</code> would be considered referenced with the Javadoc comment <code>{@link Date}</code>. The alternative to avoid introducing a compile time dependency would be to write the Javadoc comment as <code>{@link java.util.Date}</code>. </li></ul><p> The main limitation of this check is handling the case where an imported type has the same name as a declaration, such as a member variable. </p><p> For example, in the following case the import <code>java.awt.Component</code> will not be flagged as unused: </p><pre><code> import java.awt.Component; class FooBar { private Object Component; // a bad practice in my opinion ... } </code></pre>

import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;
import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;
Expand Down Expand Up @@ -47,8 +47,6 @@

@Override
public void setDependencies(Context context) {
Camera playerCamera = context.get(WorldRenderer.class).getActiveCamera();

BufferPairConnection bufferPairConnection = getInputBufferPairConnection(1);
addOutputBufferPairConnection(1, bufferPairConnection);
addOutputFboConnection(1, bufferPairConnection.getBufferPair().getPrimaryFbo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import org.terasology.engine.rendering.dag.stateChanges.SetInputTexture2D;
import org.terasology.engine.rendering.dag.stateChanges.SetViewportToSizeOf;
import org.terasology.engine.rendering.opengl.FBO;
import org.terasology.engine.rendering.opengl.fbms.DisplayResolutionDependentFbo;

Check warning on line 26 in src/main/java/org/terasology/corerendering/rendering/dag/nodes/WorldReflectionNode.java

View check run for this annotation

Terasology Jenkins.io / CheckStyle

UnusedImportsCheck

NORMAL: Unused import - org.terasology.engine.rendering.opengl.fbms.DisplayResolutionDependentFbo.
Raw output
<p>Since Checkstyle 3.0</p><p> Checks for unused import statements. Checkstyle uses a simple but very reliable algorithm to report on unused import statements. An import statement is considered unused if: </p><ul><li> It is not referenced in the file. The algorithm does not support wild-card imports like <code>import java.io.*;</code>. Most IDE's provide very sophisticated checks for imports that handle wild-card imports. </li><li> It is a duplicate of another import. This is when a class is imported more than once. </li><li> The class imported is from the <code>java.lang</code> package. For example importing <code>java.lang.String</code>. </li><li> The class imported is from the same package. </li><li><b>Optionally:</b> it is referenced in Javadoc comments. This check is on by default, but it is considered bad practice to introduce a compile time dependency for documentation purposes only. As an example, the import <code>java.util.Date</code> would be considered referenced with the Javadoc comment <code>{@link Date}</code>. The alternative to avoid introducing a compile time dependency would be to write the Javadoc comment as <code>{@link java.util.Date}</code>. </li></ul><p> The main limitation of this check is handling the case where an imported type has the same name as a declaration, such as a member variable. </p><p> For example, in the following case the import <code>java.awt.Component</code> will not be flagged as unused: </p><pre><code> import java.awt.Component; class FooBar { private Object Component; // a bad practice in my opinion ... } </code></pre>
import org.terasology.engine.rendering.primitives.ChunkMesh;
import org.terasology.engine.rendering.world.RenderQueuesHelper;
import org.terasology.engine.world.WorldProvider;
Expand Down Expand Up @@ -101,7 +101,6 @@
public void setDependencies(Context context) {
addDesiredStateChange(new ReflectedCamera(activeCamera)); // this has to go before the LookThrough state change

DisplayResolutionDependentFbo displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFbo.class);
FBO reflectedFbo = getInputFboData(1);
addOutputFboConnection(1, reflectedFbo);
addDesiredStateChange(new BindFbo(reflectedFbo));
Expand Down