AugurProject/augur-core

View on GitHub

Showing 833 of 833 total issues

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

        public logMarketMailboxTransferred_ = async(universe: string, market: string, from: string, to: string, options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_universe","type":"address"},{"name":"_market","type":"address"},{"name":"_from","type":"address"},{"name":"_to","type":"address"}],"name":"logMarketMailboxTransferred","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [universe, market, from, to], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 2 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 659..664
source/libraries/ContractInterfaces.ts on lines 757..762

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

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 3 locations. Consider refactoring.
Open

        public registerContract_ = async(key: string, address: string, commitHash: string, bytecodeHash: string, options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_key","type":"bytes32"},{"name":"_address","type":"address"},{"name":"_commitHash","type":"bytes20"},{"name":"_bytecodeHash","type":"bytes32"}],"name":"registerContract","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [key, address, commitHash, bytecodeHash], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 2 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 225..230
source/libraries/ContractInterfaces.ts on lines 659..664

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

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 8 locations. Consider refactoring.
Open

        public getExistingOrders5_ = async(type: BN, market: string, outcome: BN, options?: { sender?: string }): Promise<Array<string>> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[{"name":"_type","type":"uint8"},{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"}],"name":"getExistingOrders5","outputs":[{"name":"_results","type":"bytes32[5]"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [type, market, outcome], options.sender);
            return <Array<string>>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 7 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1688..1693
source/libraries/ContractInterfaces.ts on lines 1702..1707
source/libraries/ContractInterfaces.ts on lines 1709..1714
source/libraries/ContractInterfaces.ts on lines 1716..1721
source/libraries/ContractInterfaces.ts on lines 1723..1728
source/libraries/ContractInterfaces.ts on lines 1730..1735
source/libraries/ContractInterfaces.ts on lines 1737..1742

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

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 8 locations. Consider refactoring.
Open

        public getExistingOrders10_ = async(type: BN, market: string, outcome: BN, options?: { sender?: string }): Promise<Array<string>> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[{"name":"_type","type":"uint8"},{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"}],"name":"getExistingOrders10","outputs":[{"name":"_results","type":"bytes32[10]"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [type, market, outcome], options.sender);
            return <Array<string>>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 7 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1681..1686
source/libraries/ContractInterfaces.ts on lines 1688..1693
source/libraries/ContractInterfaces.ts on lines 1702..1707
source/libraries/ContractInterfaces.ts on lines 1709..1714
source/libraries/ContractInterfaces.ts on lines 1716..1721
source/libraries/ContractInterfaces.ts on lines 1723..1728
source/libraries/ContractInterfaces.ts on lines 1730..1735

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

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 8 locations. Consider refactoring.
Open

        public getExistingOrders500_ = async(type: BN, market: string, outcome: BN, options?: { sender?: string }): Promise<Array<string>> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[{"name":"_type","type":"uint8"},{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"}],"name":"getExistingOrders500","outputs":[{"name":"_results","type":"bytes32[500]"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [type, market, outcome], options.sender);
            return <Array<string>>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 7 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1681..1686
source/libraries/ContractInterfaces.ts on lines 1688..1693
source/libraries/ContractInterfaces.ts on lines 1702..1707
source/libraries/ContractInterfaces.ts on lines 1709..1714
source/libraries/ContractInterfaces.ts on lines 1723..1728
source/libraries/ContractInterfaces.ts on lines 1730..1735
source/libraries/ContractInterfaces.ts on lines 1737..1742

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

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 8 locations. Consider refactoring.
Open

        public getExistingOrders20_ = async(type: BN, market: string, outcome: BN, options?: { sender?: string }): Promise<Array<string>> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[{"name":"_type","type":"uint8"},{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"}],"name":"getExistingOrders20","outputs":[{"name":"_results","type":"bytes32[20]"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [type, market, outcome], options.sender);
            return <Array<string>>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 7 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1681..1686
source/libraries/ContractInterfaces.ts on lines 1702..1707
source/libraries/ContractInterfaces.ts on lines 1709..1714
source/libraries/ContractInterfaces.ts on lines 1716..1721
source/libraries/ContractInterfaces.ts on lines 1723..1728
source/libraries/ContractInterfaces.ts on lines 1730..1735
source/libraries/ContractInterfaces.ts on lines 1737..1742

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

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 8 locations. Consider refactoring.
Open

        public getExistingOrders200_ = async(type: BN, market: string, outcome: BN, options?: { sender?: string }): Promise<Array<string>> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[{"name":"_type","type":"uint8"},{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"}],"name":"getExistingOrders200","outputs":[{"name":"_results","type":"bytes32[200]"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [type, market, outcome], options.sender);
            return <Array<string>>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 7 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1681..1686
source/libraries/ContractInterfaces.ts on lines 1688..1693
source/libraries/ContractInterfaces.ts on lines 1702..1707
source/libraries/ContractInterfaces.ts on lines 1709..1714
source/libraries/ContractInterfaces.ts on lines 1716..1721
source/libraries/ContractInterfaces.ts on lines 1730..1735
source/libraries/ContractInterfaces.ts on lines 1737..1742

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

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 8 locations. Consider refactoring.
Open

        public getExistingOrders50_ = async(type: BN, market: string, outcome: BN, options?: { sender?: string }): Promise<Array<string>> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[{"name":"_type","type":"uint8"},{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"}],"name":"getExistingOrders50","outputs":[{"name":"_results","type":"bytes32[50]"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [type, market, outcome], options.sender);
            return <Array<string>>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 7 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1681..1686
source/libraries/ContractInterfaces.ts on lines 1688..1693
source/libraries/ContractInterfaces.ts on lines 1702..1707
source/libraries/ContractInterfaces.ts on lines 1716..1721
source/libraries/ContractInterfaces.ts on lines 1723..1728
source/libraries/ContractInterfaces.ts on lines 1730..1735
source/libraries/ContractInterfaces.ts on lines 1737..1742

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

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 8 locations. Consider refactoring.
Open

        public getExistingOrders100_ = async(type: BN, market: string, outcome: BN, options?: { sender?: string }): Promise<Array<string>> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[{"name":"_type","type":"uint8"},{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"}],"name":"getExistingOrders100","outputs":[{"name":"_results","type":"bytes32[100]"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [type, market, outcome], options.sender);
            return <Array<string>>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 7 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1681..1686
source/libraries/ContractInterfaces.ts on lines 1688..1693
source/libraries/ContractInterfaces.ts on lines 1702..1707
source/libraries/ContractInterfaces.ts on lines 1709..1714
source/libraries/ContractInterfaces.ts on lines 1716..1721
source/libraries/ContractInterfaces.ts on lines 1723..1728
source/libraries/ContractInterfaces.ts on lines 1737..1742

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

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 8 locations. Consider refactoring.
Open

        public getExistingOrders1000_ = async(type: BN, market: string, outcome: BN, options?: { sender?: string }): Promise<Array<string>> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[{"name":"_type","type":"uint8"},{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"}],"name":"getExistingOrders1000","outputs":[{"name":"_results","type":"bytes32[1000]"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [type, market, outcome], options.sender);
            return <Array<string>>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 7 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1681..1686
source/libraries/ContractInterfaces.ts on lines 1688..1693
source/libraries/ContractInterfaces.ts on lines 1709..1714
source/libraries/ContractInterfaces.ts on lines 1716..1721
source/libraries/ContractInterfaces.ts on lines 1723..1728
source/libraries/ContractInterfaces.ts on lines 1730..1735
source/libraries/ContractInterfaces.ts on lines 1737..1742

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

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 3 locations. Consider refactoring.
Open

        public migrateOutByPayout = async(payoutNumerators: Array<BN>, invalid: boolean, attotokens: BN, options?: { sender?: string, gasPrice?: BN }): Promise<void> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_payoutNumerators","type":"uint256[]"},{"name":"_invalid","type":"bool"},{"name":"_attotokens","type":"uint256"}],"name":"migrateOutByPayout","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            await this.remoteCall(abi, [payoutNumerators, invalid, attotokens], "migrateOutByPayout", options.sender, options.gasPrice);
            return;
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 2 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 3571..3576
source/libraries/ContractInterfaces.ts on lines 3977..3982

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

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 3 locations. Consider refactoring.
Open

        public contribute = async(payoutNumerators: Array<BN>, invalid: boolean, amount: BN, options?: { sender?: string, gasPrice?: BN }): Promise<void> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_payoutNumerators","type":"uint256[]"},{"name":"_invalid","type":"bool"},{"name":"_amount","type":"uint256"}],"name":"contribute","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            await this.remoteCall(abi, [payoutNumerators, invalid, amount], "contribute", options.sender, options.gasPrice);
            return;
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 2 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1142..1147
source/libraries/ContractInterfaces.ts on lines 3977..3982

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

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 3 locations. Consider refactoring.
Open

        public migrateOutByPayout = async(payoutNumerators: Array<BN>, invalid: boolean, attotokens: BN, options?: { sender?: string, gasPrice?: BN }): Promise<void> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_payoutNumerators","type":"uint256[]"},{"name":"_invalid","type":"bool"},{"name":"_attotokens","type":"uint256"}],"name":"migrateOutByPayout","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            await this.remoteCall(abi, [payoutNumerators, invalid, attotokens], "migrateOutByPayout", options.sender, options.gasPrice);
            return;
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 2 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1142..1147
source/libraries/ContractInterfaces.ts on lines 3571..3576

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

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_universe","type":"address"},{"name":"_shareToken","type":"address"},{"name":"_filler","type":"address"},{"name":"_orderId","type":"bytes32"},{"name":"_numCreatorShares","type":"uint256"},{"name":"_numCreatorTokens","type":"uint256"},{"name":"_numFillerShares","type":"uint256"},{"name":"_numFillerTokens","type":"uint256"},{"name":"_marketCreatorFees","type":"uint256"},{"name":"_reporterFees","type":"uint256"},{"name":"_amountFilled","type":"uint256"},{"name":"_tradeGroupId","type":"bytes32"}],"name":"logOrderFilled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 1 other location - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 451..451

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

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 3 locations. Consider refactoring.
Open

        public migrateOutByPayout_ = async(payoutNumerators: Array<BN>, invalid: boolean, attotokens: BN, options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_payoutNumerators","type":"uint256[]"},{"name":"_invalid","type":"bool"},{"name":"_attotokens","type":"uint256"}],"name":"migrateOutByPayout","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [payoutNumerators, invalid, attotokens], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 2 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 3578..3583
source/libraries/ContractInterfaces.ts on lines 3984..3989

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

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_universe","type":"address"},{"name":"_shareToken","type":"address"},{"name":"_filler","type":"address"},{"name":"_orderId","type":"bytes32"},{"name":"_numCreatorShares","type":"uint256"},{"name":"_numCreatorTokens","type":"uint256"},{"name":"_numFillerShares","type":"uint256"},{"name":"_numFillerTokens","type":"uint256"},{"name":"_marketCreatorFees","type":"uint256"},{"name":"_reporterFees","type":"uint256"},{"name":"_amountFilled","type":"uint256"},{"name":"_tradeGroupId","type":"bytes32"}],"name":"logOrderFilled","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 1 other location - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 444..444

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

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 3 locations. Consider refactoring.
Open

        public migrateOutByPayout_ = async(payoutNumerators: Array<BN>, invalid: boolean, attotokens: BN, options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_payoutNumerators","type":"uint256[]"},{"name":"_invalid","type":"bool"},{"name":"_attotokens","type":"uint256"}],"name":"migrateOutByPayout","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [payoutNumerators, invalid, attotokens], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 2 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1149..1154
source/libraries/ContractInterfaces.ts on lines 3578..3583

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

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 3 locations. Consider refactoring.
Open

        public contribute_ = async(payoutNumerators: Array<BN>, invalid: boolean, amount: BN, options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_payoutNumerators","type":"uint256[]"},{"name":"_invalid","type":"bool"},{"name":"_amount","type":"uint256"}],"name":"contribute","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [payoutNumerators, invalid, amount], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 2 other locations - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 1149..1154
source/libraries/ContractInterfaces.ts on lines 3984..3989

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

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 2 locations. Consider refactoring.
Open

        public setPrice = async(market: string, outcome: BN, price: BN, options?: { sender?: string, gasPrice?: BN }): Promise<void> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"},{"name":"_price","type":"uint256"}],"name":"setPrice","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            await this.remoteCall(abi, [market, outcome, price], "setPrice", options.sender, options.gasPrice);
            return;
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 1 other location - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 5559..5564

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

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 2 locations. Consider refactoring.
Open

        public recordFillOrder = async(orderId: string, sharesFilled: BN, tokensFilled: BN, options?: { sender?: string, gasPrice?: BN }): Promise<void> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_orderId","type":"bytes32"},{"name":"_sharesFilled","type":"uint256"},{"name":"_tokensFilled","type":"uint256"}],"name":"recordFillOrder","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            await this.remoteCall(abi, [orderId, sharesFilled, tokensFilled], "recordFillOrder", options.sender, options.gasPrice);
            return;
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 1 other location - About 1 day to fix
source/libraries/ContractInterfaces.ts on lines 5573..5578

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

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