trufflesuite/truffle

View on GitHub

Showing 1,401 of 1,401 total issues

Function evalAndPrintExpression has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  async evalAndPrintExpression(raw, indent, suppress) {
    let variables = await this.session.variables({ indicateUnknown: true });

    //if we're just dealing with a single variable, handle that case
    //separately (so that we can do things in a better way for that
Severity: Minor
Found in packages/core/lib/debug/printer.js - About 55 mins to fix

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

Function constructor has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(info: Types.EncoderInfoInternal) {
    //first, set up the basic info that we need to run
    if (info.userDefinedTypes && info.allocations) {
      debug("internal route!");
      this.userDefinedTypes = info.userDefinedTypes;
Severity: Minor
Found in packages/encoder/lib/encoders.ts - About 55 mins to fix

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

Function resolveContractInstances has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export async function resolveContractInstances(
  project: IdObject<"projects">,
  inputs: {
    contract?: DataModel.ResourceNameInput;
    address?: string;
Severity: Minor
Found in packages/db/src/resources/projects/resolveContractInstances.ts - About 55 mins to fix

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

Function decodeMagic has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function* decodeMagic(
  dataType: Format.Types.MagicType,
  pointer: Pointer.SpecialPointer,
  info: Evm.EvmInfo
): Generator<DecoderRequest, Format.Values.MagicResult, Uint8Array | null> {
Severity: Minor
Found in packages/codec/lib/special/decode/index.ts - About 55 mins to fix

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

Function run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export async function run(
  rawSources: { [name: string]: string },
  options: Config,
  internalOptions: InternalOptions = {}
): Promise<Compilation | null> {
Severity: Minor
Found in packages/compile-solidity/src/run.ts - About 55 mins to fix

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

Function DecodeAddressResult has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const DecodeAddressResult = ({ decoder, address }: Props) => {
  const [width, setWidth] = useState(80);
  const ref = useRef();

  useEffect(() => {
Severity: Minor
Found in packages/db-kit/src/cli/decodeAddress/Result.tsx - About 55 mins to fix

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

Function processResult has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  private static processResult(
    result: EtherscanResult
  ): Types.SourceInfo | null {
    //we have 5 cases here.
    //case 1: the address doesn't exist
Severity: Minor
Found in packages/source-fetcher/lib/etherscan.ts - About 55 mins to fix

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

Function search has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

  public static search(options: any = {}, filename?: string): string | null {
    const searchOptions = {
      cwd: options.working_directory || options.workingDirectory
    };

Severity: Minor
Found in packages/config/src/index.ts - About 55 mins to fix

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

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  source: {
    get: function () {
      return this._json.source;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  sourcePath: {
    get: function () {
      return this._json.sourcePath;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  timeoutBlocks: {
    get: function () {
      return this._json.timeoutBlocks;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  ast: {
    get: function () {
      return this._json.ast;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  deployedGeneratedSources: {
    get: function () {
      return this._json.deployedGeneratedSources;
    },
    set: function (sources) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  sourceMap: {
    get: function () {
      return this._json.sourceMap;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  legacyAST: {
    get: function () {
      return this._json.legacyAST;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  compiler: {
    get: function () {
      return this._json.compiler;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  immutableReferences: {
    get: function () {
      return this._json.immutableReferences;
    },
    set: function (refs) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  deployedSourceMap: {
    get: function () {
      return this._json.deployedSourceMap;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  abi: {
    get: function () {
      return this._json.abi;
    },
    set: function (val) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 388..395
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Similar blocks of code found in 14 locations. Consider refactoring.
Open

  generatedSources: {
    get: function () {
      return this._json.generatedSources;
    },
    set: function (sources) {
Severity: Major
Found in packages/contract/lib/contract/properties.js and 13 other locations - About 55 mins to fix
packages/contract/lib/contract/properties.js on lines 33..40
packages/contract/lib/contract/properties.js on lines 71..78
packages/contract/lib/contract/properties.js on lines 175..182
packages/contract/lib/contract/properties.js on lines 292..299
packages/contract/lib/contract/properties.js on lines 300..307
packages/contract/lib/contract/properties.js on lines 308..315
packages/contract/lib/contract/properties.js on lines 316..323
packages/contract/lib/contract/properties.js on lines 324..331
packages/contract/lib/contract/properties.js on lines 332..339
packages/contract/lib/contract/properties.js on lines 340..347
packages/contract/lib/contract/properties.js on lines 380..387
packages/contract/lib/contract/properties.js on lines 396..403
packages/contract/lib/contract/properties.js on lines 404..411

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 53.

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

Further Reading

Severity
Category
Status
Source
Language