ZuInnoTe / hadoopcryptoledger

Hadoop Crypto Ledger - Analyzing CryptoLedgers, such as Bitcoin Blockchain, on Big Data platforms, such as Hadoop/Spark/Flink/Hive
Apache License 2.0
141 stars 51 forks source link

Refactor code smells v2 #89

Closed BennyDanielT closed 2 years ago

BennyDanielT commented 2 years ago

The following items were changed:

Rename Variables that contain typos:

inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/mapred/AbstractBitcoinFileInputFormat.java

Rename CONF_ISSPLITABLE to CONF_IS_SPLITTABLE Rename DEFAULT_ISSPLITABLE to DEFAULT_IS_SPLITTABLE Classes: inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/mapred/AbstractBitcoinFileInputFormat.java inputformat/src/main/java/org/zuinnote/hadoop/bitcoin/format/mapreduce/AbstractBitcoinFileInputFormat.java

Extract a large method into smaller methods:

Classes: inputformat/src/test/java/org/zuinnote/hadoop/ethereum/format/common/EthereumFormatReaderTest.java Method: parseBlock1346406AsEthereumBlockHeap parseBlock1346406AsEthereumBlockDirect

Resolve Cyclic Dependency between EthereumTransaction & EthereumUtil by introducing an Interface and making EthereumUtil implement it

Classes: inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumTransaction.java inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java New Interface: inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumTransactionInterface.java

Extract a class that has a high Lack of Cohesion among Methods (LCOM) value and decompose it into cohesive classes

Class Decomposed - inputformat/src/test/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtilTest.java New Classes: inputformat/src/test/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtilBlockTest.java inputformat/src/test/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtilDecodeTest.java inputformat/src/test/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtilEncodeTest.java