Skip to content

Commit

Permalink
Fix code quality issues
Browse files Browse the repository at this point in the history
Per Codacy report at
https://app.codacy.com/gh/bisq-network/bisq/pullRequest?prid=4835062

Note that the items claiming that bisq.common.config.Config.* is an
unused import are false positives. These imports are in fact used in
every case.
  • Loading branch information
cbeams committed Jan 17, 2020
1 parent 83a2fc8 commit 918c6c1
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 15 deletions.
2 changes: 0 additions & 2 deletions common/src/main/java/bisq/common/crypto/CryptoUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

package bisq.common.crypto;

import bisq.common.util.Utilities;

import javax.crypto.Cipher;

import java.security.NoSuchAlgorithmException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package bisq.common.config;

import org.junit.Assert;
import org.junit.Test;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.contains;

public class ConfigFileOptionTests {

Expand Down
3 changes: 1 addition & 2 deletions core/src/main/java/bisq/core/btc/BitcoinModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

import com.google.inject.Singleton;
import com.google.inject.TypeLiteral;
import com.google.inject.name.Names;

import java.io.File;

Expand Down Expand Up @@ -83,7 +82,7 @@ protected void configure() {
bindConstant().annotatedWith(named(Config.NUM_CONNECTIONS_FOR_BTC)).to(config.numConnectionsForBtc);
bindConstant().annotatedWith(named(Config.USE_ALL_PROVIDED_NODES)).to(config.useAllProvidedNodes);
bindConstant().annotatedWith(named(Config.IGNORE_LOCAL_BTC_NODE)).to(config.ignoreLocalBtcNode);
bindConstant().annotatedWith(Names.named(Config.SOCKS5_DISCOVER_MODE)).to(config.socks5DiscoverMode);
bindConstant().annotatedWith(named(Config.SOCKS5_DISCOVER_MODE)).to(config.socks5DiscoverMode);
bind(new TypeLiteral<List<String>>(){}).annotatedWith(named(PROVIDERS)).toInstance(config.providers);

bind(AddressEntryList.class).in(Singleton.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

import bisq.core.locale.GlobalSettings;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.util.coin.CoinFormatter;
import bisq.core.util.coin.ImmutableCoinFormatter;

import bisq.common.config.Config;

import javafx.beans.property.SimpleIntegerProperty;

Expand All @@ -49,8 +45,6 @@

public class OfferBookChartViewModelTest {

private final CoinFormatter coinFormatter = new ImmutableCoinFormatter(Config.baseCurrencyNetworkParameters().getMonetaryFormat());

@Before
public void setUp() {
GlobalSettings.setDefaultTradeCurrency(usd);
Expand Down
5 changes: 2 additions & 3 deletions p2p/src/main/java/bisq/network/p2p/P2PModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@

import com.google.inject.Singleton;
import com.google.inject.TypeLiteral;
import com.google.inject.name.Names;

import java.time.Clock;

Expand Down Expand Up @@ -75,11 +74,11 @@ protected void configure() {

requestStaticInjection(Connection.class);

bindConstant().annotatedWith(Names.named(USE_LOCALHOST_FOR_P2P)).to(config.useLocalhostForP2P);
bindConstant().annotatedWith(named(USE_LOCALHOST_FOR_P2P)).to(config.useLocalhostForP2P);

bind(File.class).annotatedWith(named(TOR_DIR)).toInstance(config.torDir);

bind(int.class).annotatedWith(Names.named(NODE_PORT)).toInstance(config.nodePort);
bind(int.class).annotatedWith(named(NODE_PORT)).toInstance(config.nodePort);

bindConstant().annotatedWith(named(MAX_CONNECTIONS)).to(config.maxConnections);

Expand Down

0 comments on commit 918c6c1

Please sign in to comment.