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

Inscriber TESR performance improvement #3604

Merged
merged 1 commit into from Jul 14, 2018
Merged

Inscriber TESR performance improvement #3604

merged 1 commit into from Jul 14, 2018

Conversation

@fscan
Copy link
Member

@fscan fscan commented Jul 10, 2018

Cache current task to not recalculate every frame, minimize state changes in TESR.

recipe.getTopOptional().orElse( ItemStack.EMPTY ) ) ) && // and...
( ( plateA.isEmpty() && !recipe.getBottomOptional().isPresent() ) || ( Platform.itemComparisons().isSameItem( plateA,
recipe.getBottomOptional().orElse( ItemStack.EMPTY ) ) ) );
final boolean matchB = ( plateB.isEmpty() && !recipe.getTopOptional().isPresent() ) || ( Platform.itemComparisons()

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

CRITICAL Reduce the number of conditional operators (5) used in the expression (maximum allowed 3). rule

recipe.getTopOptional().orElse( ItemStack.EMPTY ) ) ) && // and...
( ( plateB.isEmpty() && !recipe.getBottomOptional().isPresent() ) || ( Platform.itemComparisons().isSameItem( plateB,
recipe.getBottomOptional().orElse( ItemStack.EMPTY ) ) ) );
final boolean matchA = ( plateA.isEmpty() && !recipe.getTopOptional().isPresent() ) || ( Platform.itemComparisons()

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

CRITICAL Reduce the number of conditional operators (5) used in the expression (maximum allowed 3). rule

GlStateManager.enableLighting();
GlStateManager.enableRescaleNormal();
}

private void renderItem( ItemStack sis, final float o, final AEBaseTile tile, final BufferBuilder tess, final double x, final double y, final double z )
private void renderItem( final ItemStack stack, final float o, final AEBaseTile tile, final double x, final double y, final double z )

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

MAJOR Remove these unused method parameters. rule

@orod-org
Copy link

@orod-org orod-org commented Jul 10, 2018

SonarQube analysis reported 8 issues

  • CRITICAL 7 critical
  • MAJOR 1 major

Watch the comments in this conversation to review them.

4 extra issues

Note: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:

  1. CRITICAL TileInscriber.java#L297: The Cyclomatic Complexity of this method "getTask" is 28 which is greater than 10 authorized. rule
  2. CRITICAL TileInscriber.java#L348: Refactor this code to not nest more than 3 if/for/while/switch/try statements. rule
  3. CRITICAL TileInscriber.java#L372: Refactor this code to not nest more than 3 if/for/while/switch/try statements. rule
  4. CRITICAL TileInscriber.java#L437: Refactor this code to not nest more than 3 if/for/while/switch/try statements. rule
@@ -42,7 +40,7 @@
private static TextureAtlasSprite textureInside;

@Override
public void render( TileInscriber tile, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
public void render( final TileInscriber tile, final double x, final double y, final double z, final float partialTicks, final int destroyStage, final float p_render_10_ )

This comment has been minimized.

@orod-org

orod-org Jul 10, 2018

CRITICAL The Cyclomatic Complexity of this method "render" is 12 which is greater than 10 authorized. rule

@yueh yueh added this to the rv6.alpha - 1.12 milestone Jul 11, 2018
@fscan fscan merged commit 8f6f35b into rv6-1.12 Jul 14, 2018
3 of 4 checks passed
3 of 4 checks passed
sonarqube SonarQube reported 8 issues, with 7 critical
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
jenkins Success
Details
@fscan fscan deleted the inscriber-tesr branch Jul 14, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.