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

Layers and IC2 Tunnel #2565

Merged
merged 3 commits into from Nov 4, 2016
Merged

Layers and IC2 Tunnel #2565

merged 3 commits into from Nov 4, 2016

Conversation

shartte
Copy link
Member

@shartte shartte commented Nov 4, 2016

Refactored layers and implemented IC2 Tunnel on top of it

…y -1 was returned, causing the ENet to ignore the P2P output side. Sadly, the tier cannot be changed once the tile is registered, so we're going with the highest there is. The effect of this is not quite clear at this point... kaboom?
@@ -28,7 +28,6 @@
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

import javax.annotation.Nonnull;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR 'javax.annotation.Nonnull' should be separated from previous imports. rule

return cache.getUnchecked( new CacheKey( baseClass, this.desc ) );
}

private Class<? extends AEBaseTile> generateCombinedClass( CacheKey cacheKey )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Move this method into the anonymous class declared at line 71. rule

@@ -222,8 +225,15 @@ String getUnlocalizedName()
}
},

// P2PTunnelEU( 465, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelEU ), EnumSet.of( IntegrationType.IC2 ),
// PartP2PIC2Power.class, GuiText.EUTunnel ),
P2PTunnelEU( 465, "p2p_tunnel_ic2", EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelEU ), EnumSet.of( IntegrationType.IC2 ),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL Rename this constant name to match the regular expression '^[A-Z][A-Z0-9]([A-Z0-9]+)_$'. rule

}

@Override
public double injectEnergy( EnumFacing directionFrom, double amount, double voltage )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

}
}
}
catch( GridAccessException e )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Either log or rethrow this exception. rule

{
outs = this.getOutputs();
}
catch( GridAccessException e )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR Either log or rethrow this exception. rule

}

// Buffer the energy + voltage for two IC2 ENET packets
private double bufferedEnergy1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Move this variable to comply with Java Code Conventions. rule


// Buffer the energy + voltage for two IC2 ENET packets
private double bufferedEnergy1;
private double bufferedVoltage1;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Move this variable to comply with Java Code Conventions. rule

// Buffer the energy + voltage for two IC2 ENET packets
private double bufferedEnergy1;
private double bufferedVoltage1;
private double bufferedEnergy2;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Move this variable to comply with Java Code Conventions. rule

private double bufferedEnergy1;
private double bufferedVoltage1;
private double bufferedEnergy2;
private double bufferedVoltage2;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Move this variable to comply with Java Code Conventions. rule

private double bufferedEnergy2;
private double bufferedVoltage2;

public PartP2PIC2Power( ItemStack is )
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MINOR Move this constructor to comply with Java Code Conventions. rule

@orod-org
Copy link

orod-org commented Nov 4, 2016

SonarQube analysis reported 16 issues

  • CRITICAL 2 critical
  • MAJOR 7 major
  • MINOR 7 minor

Watch the comments in this conversation to review them.

5 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. MAJOR ApiPart.java#L190: Method appeng.core.api.ApiPart.getClassByDesc(Class, String) passes constant String of length 1 to character overridden method rule
  2. MAJOR ApiPart.java#L238: Method appeng.core.api.ApiPart.getReader(String) passes constant String of length 1 to character overridden method rule
  3. MAJOR PartP2PTunnel.java#L171: Method appeng.parts.p2p.PartP2PTunnel.onPartActivate(EntityPlayer, EnumHand, Vec3d) appears to call the same method on the same object redundantly rule
  4. MAJOR PartP2PTunnel.java#L181: Method appeng.parts.p2p.PartP2PTunnel.onPartActivate(EntityPlayer, EnumHand, Vec3d) appears to call the same method on the same object redundantly rule
  5. MAJOR PartP2PTunnel.java#L308: Method appeng.parts.p2p.PartP2PTunnel.onPartShiftActivate(EntityPlayer, EnumHand, Vec3d) appears to call the same method on the same object redundantly rule

@shartte shartte merged commit f5e4a20 into master Nov 4, 2016
@shartte shartte deleted the ic2-p2p branch November 4, 2016 10:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants