Showing 1,401 of 1,401 total issues
File decoders.ts
has 1877 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("decoder:decoders");
import * as Abi from "@truffle/abi-utils";
import * as Codec from "@truffle/codec";
Similar blocks of code found in 2 locations. Consider refactoring. Open
const spinners = Object.entries(statusByAddress).map(([address, status]) => {
switch (status) {
case "querying":
return (
<Box key={`address-${address}`}>
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 672.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
const spinners = Object.entries(statusByAddress).map(([address, status]) => {
switch (status) {
case "querying":
return (
<Box key={`address-${address}`}>
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 672.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File index.js
has 1227 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("debugger:data:selectors");
import { createSelectorTree, createLeaf } from "reselect-tree";
import jsonpointer from "json-pointer";
Function interpreter
has a Cognitive Complexity of 132 (exceeds 5 allowed). Consider refactoring. Open
async interpreter(cmd) {
cmd = cmd.trim();
let cmdArgs, splitArgs;
debug("cmd %s", cmd);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File index.js
has 1029 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("debugger:data:sagas");
import { put, takeEvery, select } from "redux-saga/effects";
Function variablesAndMappingsSaga
has 487 lines of code (exceeds 25 allowed). Consider refactoring. Open
function* variablesAndMappingsSaga() {
// stack is only ready for interpretation after the last step of each
// source range
//
// the data module always looks at the result of a particular opcode
Function interpreter
has 399 lines of code (exceeds 25 allowed). Consider refactoring. Open
async interpreter(cmd) {
cmd = cmd.trim();
let cmdArgs, splitArgs;
debug("cmd %s", cmd);
File encoders.ts
has 813 lines of code (exceeds 250 allowed). Consider refactoring. Open
import debugModule from "debug";
const debug = debugModule("encoder:encoders");
import { FixedNumber as EthersFixedNumber } from "@ethersproject/bignumber";
import { getAddress } from "@ethersproject/address";
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const { TupleValue } = createCodecComponent(
"TupleValue",
({ value }: Format.Values.TupleValue) => {
const { prefix, suffix } = useInjectedNode();
return (
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 319.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const { ArrayValue } = createCodecComponent(
"ArrayValue",
({ value }: Format.Values.ArrayValue) => {
const { prefix, suffix } = useInjectedNode();
return (
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 319.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function normalize
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
static normalize(compilations) {
let contexts = [];
let sources = {
user: {}, //by compilation
internal: {} //by context
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File index.js
has 738 lines of code (exceeds 250 allowed). Consider refactoring. Open
const OS = require("os");
const debug = require("debug")("debug-utils");
const util = require("util");
const Codec = require("@truffle/codec");
const BN = require("bn.js");
Function variablesAndMappingsSaga
has a Cognitive Complexity of 85 (exceeds 5 allowed). Consider refactoring. Open
function* variablesAndMappingsSaga() {
// stack is only ready for interpretation after the last step of each
// source range
//
// the data module always looks at the result of a particular opcode
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File printer.js
has 726 lines of code (exceeds 250 allowed). Consider refactoring. Open
const debugModule = require("debug");
const debug = debugModule("lib:debug:printer");
const path = require("path");
const util = require("util");
Similar blocks of code found in 2 locations. Consider refactoring. Open
public async update<M extends MutableCollectionName<C>>(
collectionName: M,
input: MutationInput<C, M>
): Promise<MutationPayload<C, M>> {
const log = debug.extend(`${collectionName}:update`);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 303.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public async add<N extends CollectionName<C>>(
collectionName: N,
input: MutationInput<C, N>
): Promise<MutationPayload<C, N>> {
const log = debug.extend(`${collectionName}:add`);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 303.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function transactionLog
has 326 lines of code (exceeds 25 allowed). Consider refactoring. Open
function transactionLog(state = DEFAULT_TX_LOG, action) {
const { pointer, newPointer, step } = action;
const node = state.byPointer[pointer];
switch (action.type) {
case actions.RECORD_ORIGIN:
File interpreter.js
has 698 lines of code (exceeds 250 allowed). Consider refactoring. Open
const debugModule = require("debug");
const debug = debugModule("lib:debug:interpreter");
const path = require("path");
const util = require("util");
Function transactionLog
has a Cognitive Complexity of 80 (exceeds 5 allowed). Consider refactoring. Open
function transactionLog(state = DEFAULT_TX_LOG, action) {
const { pointer, newPointer, step } = action;
const node = state.byPointer[pointer];
switch (action.type) {
case actions.RECORD_ORIGIN:
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"