AugurProject/augur-core

View on GitHub

Showing 833 of 833 total issues

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

        public addMarketTo_ = async( options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[],"name":"addMarketTo","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 61 other locations - About 5 hrs to fix
source/libraries/ContractInterfaces.ts on lines 281..286
source/libraries/ContractInterfaces.ts on lines 743..748
source/libraries/ContractInterfaces.ts on lines 764..769
source/libraries/ContractInterfaces.ts on lines 792..797
source/libraries/ContractInterfaces.ts on lines 799..804
source/libraries/ContractInterfaces.ts on lines 939..944
source/libraries/ContractInterfaces.ts on lines 960..965
source/libraries/ContractInterfaces.ts on lines 1002..1007
source/libraries/ContractInterfaces.ts on lines 1219..1224
source/libraries/ContractInterfaces.ts on lines 1310..1315
source/libraries/ContractInterfaces.ts on lines 1443..1448
source/libraries/ContractInterfaces.ts on lines 1625..1630
source/libraries/ContractInterfaces.ts on lines 2115..2120
source/libraries/ContractInterfaces.ts on lines 2143..2148
source/libraries/ContractInterfaces.ts on lines 2178..2183
source/libraries/ContractInterfaces.ts on lines 2192..2197
source/libraries/ContractInterfaces.ts on lines 2227..2232
source/libraries/ContractInterfaces.ts on lines 2290..2295
source/libraries/ContractInterfaces.ts on lines 2360..2365
source/libraries/ContractInterfaces.ts on lines 2409..2414
source/libraries/ContractInterfaces.ts on lines 2619..2624
source/libraries/ContractInterfaces.ts on lines 2682..2687
source/libraries/ContractInterfaces.ts on lines 2794..2799
source/libraries/ContractInterfaces.ts on lines 2871..2876
source/libraries/ContractInterfaces.ts on lines 2892..2897
source/libraries/ContractInterfaces.ts on lines 2913..2918
source/libraries/ContractInterfaces.ts on lines 3004..3009
source/libraries/ContractInterfaces.ts on lines 3018..3023
source/libraries/ContractInterfaces.ts on lines 3032..3037
source/libraries/ContractInterfaces.ts on lines 3046..3051
source/libraries/ContractInterfaces.ts on lines 3060..3065
source/libraries/ContractInterfaces.ts on lines 3074..3079
source/libraries/ContractInterfaces.ts on lines 3116..3121
source/libraries/ContractInterfaces.ts on lines 3130..3135
source/libraries/ContractInterfaces.ts on lines 3144..3149
source/libraries/ContractInterfaces.ts on lines 3193..3198
source/libraries/ContractInterfaces.ts on lines 3221..3226
source/libraries/ContractInterfaces.ts on lines 3249..3254
source/libraries/ContractInterfaces.ts on lines 3340..3345
source/libraries/ContractInterfaces.ts on lines 3389..3394
source/libraries/ContractInterfaces.ts on lines 3417..3422
source/libraries/ContractInterfaces.ts on lines 3431..3436
source/libraries/ContractInterfaces.ts on lines 3515..3520
source/libraries/ContractInterfaces.ts on lines 3543..3548
source/libraries/ContractInterfaces.ts on lines 3557..3562
source/libraries/ContractInterfaces.ts on lines 3648..3653
source/libraries/ContractInterfaces.ts on lines 3662..3667
source/libraries/ContractInterfaces.ts on lines 3669..3674
source/libraries/ContractInterfaces.ts on lines 3697..3702
source/libraries/ContractInterfaces.ts on lines 3753..3758
source/libraries/ContractInterfaces.ts on lines 3767..3772
source/libraries/ContractInterfaces.ts on lines 3809..3814
source/libraries/ContractInterfaces.ts on lines 4040..4045
source/libraries/ContractInterfaces.ts on lines 4131..4136
source/libraries/ContractInterfaces.ts on lines 4264..4269
source/libraries/ContractInterfaces.ts on lines 4404..4409
source/libraries/ContractInterfaces.ts on lines 4523..4528
source/libraries/ContractInterfaces.ts on lines 4607..4612
source/libraries/ContractInterfaces.ts on lines 4712..4717
source/libraries/ContractInterfaces.ts on lines 4873..4878
source/libraries/ContractInterfaces.ts on lines 6084..6089

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

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

        public emergencyStop_ = async( options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[],"name":"emergencyStop","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 61 other locations - About 5 hrs to fix
source/libraries/ContractInterfaces.ts on lines 281..286
source/libraries/ContractInterfaces.ts on lines 743..748
source/libraries/ContractInterfaces.ts on lines 764..769
source/libraries/ContractInterfaces.ts on lines 799..804
source/libraries/ContractInterfaces.ts on lines 939..944
source/libraries/ContractInterfaces.ts on lines 960..965
source/libraries/ContractInterfaces.ts on lines 1002..1007
source/libraries/ContractInterfaces.ts on lines 1219..1224
source/libraries/ContractInterfaces.ts on lines 1310..1315
source/libraries/ContractInterfaces.ts on lines 1443..1448
source/libraries/ContractInterfaces.ts on lines 1625..1630
source/libraries/ContractInterfaces.ts on lines 2115..2120
source/libraries/ContractInterfaces.ts on lines 2143..2148
source/libraries/ContractInterfaces.ts on lines 2178..2183
source/libraries/ContractInterfaces.ts on lines 2192..2197
source/libraries/ContractInterfaces.ts on lines 2227..2232
source/libraries/ContractInterfaces.ts on lines 2290..2295
source/libraries/ContractInterfaces.ts on lines 2360..2365
source/libraries/ContractInterfaces.ts on lines 2409..2414
source/libraries/ContractInterfaces.ts on lines 2619..2624
source/libraries/ContractInterfaces.ts on lines 2682..2687
source/libraries/ContractInterfaces.ts on lines 2794..2799
source/libraries/ContractInterfaces.ts on lines 2871..2876
source/libraries/ContractInterfaces.ts on lines 2892..2897
source/libraries/ContractInterfaces.ts on lines 2913..2918
source/libraries/ContractInterfaces.ts on lines 3004..3009
source/libraries/ContractInterfaces.ts on lines 3018..3023
source/libraries/ContractInterfaces.ts on lines 3032..3037
source/libraries/ContractInterfaces.ts on lines 3046..3051
source/libraries/ContractInterfaces.ts on lines 3060..3065
source/libraries/ContractInterfaces.ts on lines 3074..3079
source/libraries/ContractInterfaces.ts on lines 3116..3121
source/libraries/ContractInterfaces.ts on lines 3130..3135
source/libraries/ContractInterfaces.ts on lines 3144..3149
source/libraries/ContractInterfaces.ts on lines 3193..3198
source/libraries/ContractInterfaces.ts on lines 3221..3226
source/libraries/ContractInterfaces.ts on lines 3249..3254
source/libraries/ContractInterfaces.ts on lines 3340..3345
source/libraries/ContractInterfaces.ts on lines 3389..3394
source/libraries/ContractInterfaces.ts on lines 3417..3422
source/libraries/ContractInterfaces.ts on lines 3431..3436
source/libraries/ContractInterfaces.ts on lines 3515..3520
source/libraries/ContractInterfaces.ts on lines 3543..3548
source/libraries/ContractInterfaces.ts on lines 3557..3562
source/libraries/ContractInterfaces.ts on lines 3648..3653
source/libraries/ContractInterfaces.ts on lines 3662..3667
source/libraries/ContractInterfaces.ts on lines 3669..3674
source/libraries/ContractInterfaces.ts on lines 3697..3702
source/libraries/ContractInterfaces.ts on lines 3753..3758
source/libraries/ContractInterfaces.ts on lines 3767..3772
source/libraries/ContractInterfaces.ts on lines 3809..3814
source/libraries/ContractInterfaces.ts on lines 4040..4045
source/libraries/ContractInterfaces.ts on lines 4131..4136
source/libraries/ContractInterfaces.ts on lines 4264..4269
source/libraries/ContractInterfaces.ts on lines 4404..4409
source/libraries/ContractInterfaces.ts on lines 4523..4528
source/libraries/ContractInterfaces.ts on lines 4607..4612
source/libraries/ContractInterfaces.ts on lines 4712..4717
source/libraries/ContractInterfaces.ts on lines 4873..4878
source/libraries/ContractInterfaces.ts on lines 4929..4934
source/libraries/ContractInterfaces.ts on lines 6084..6089

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

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

        public updateParentTotalTheoreticalSupply_ = async( options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[],"name":"updateParentTotalTheoreticalSupply","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 61 other locations - About 5 hrs to fix
source/libraries/ContractInterfaces.ts on lines 281..286
source/libraries/ContractInterfaces.ts on lines 743..748
source/libraries/ContractInterfaces.ts on lines 764..769
source/libraries/ContractInterfaces.ts on lines 792..797
source/libraries/ContractInterfaces.ts on lines 799..804
source/libraries/ContractInterfaces.ts on lines 939..944
source/libraries/ContractInterfaces.ts on lines 960..965
source/libraries/ContractInterfaces.ts on lines 1002..1007
source/libraries/ContractInterfaces.ts on lines 1219..1224
source/libraries/ContractInterfaces.ts on lines 1443..1448
source/libraries/ContractInterfaces.ts on lines 1625..1630
source/libraries/ContractInterfaces.ts on lines 2115..2120
source/libraries/ContractInterfaces.ts on lines 2143..2148
source/libraries/ContractInterfaces.ts on lines 2178..2183
source/libraries/ContractInterfaces.ts on lines 2192..2197
source/libraries/ContractInterfaces.ts on lines 2227..2232
source/libraries/ContractInterfaces.ts on lines 2290..2295
source/libraries/ContractInterfaces.ts on lines 2360..2365
source/libraries/ContractInterfaces.ts on lines 2409..2414
source/libraries/ContractInterfaces.ts on lines 2619..2624
source/libraries/ContractInterfaces.ts on lines 2682..2687
source/libraries/ContractInterfaces.ts on lines 2794..2799
source/libraries/ContractInterfaces.ts on lines 2871..2876
source/libraries/ContractInterfaces.ts on lines 2892..2897
source/libraries/ContractInterfaces.ts on lines 2913..2918
source/libraries/ContractInterfaces.ts on lines 3004..3009
source/libraries/ContractInterfaces.ts on lines 3018..3023
source/libraries/ContractInterfaces.ts on lines 3032..3037
source/libraries/ContractInterfaces.ts on lines 3046..3051
source/libraries/ContractInterfaces.ts on lines 3060..3065
source/libraries/ContractInterfaces.ts on lines 3074..3079
source/libraries/ContractInterfaces.ts on lines 3116..3121
source/libraries/ContractInterfaces.ts on lines 3130..3135
source/libraries/ContractInterfaces.ts on lines 3144..3149
source/libraries/ContractInterfaces.ts on lines 3193..3198
source/libraries/ContractInterfaces.ts on lines 3221..3226
source/libraries/ContractInterfaces.ts on lines 3249..3254
source/libraries/ContractInterfaces.ts on lines 3340..3345
source/libraries/ContractInterfaces.ts on lines 3389..3394
source/libraries/ContractInterfaces.ts on lines 3417..3422
source/libraries/ContractInterfaces.ts on lines 3431..3436
source/libraries/ContractInterfaces.ts on lines 3515..3520
source/libraries/ContractInterfaces.ts on lines 3543..3548
source/libraries/ContractInterfaces.ts on lines 3557..3562
source/libraries/ContractInterfaces.ts on lines 3648..3653
source/libraries/ContractInterfaces.ts on lines 3662..3667
source/libraries/ContractInterfaces.ts on lines 3669..3674
source/libraries/ContractInterfaces.ts on lines 3697..3702
source/libraries/ContractInterfaces.ts on lines 3753..3758
source/libraries/ContractInterfaces.ts on lines 3767..3772
source/libraries/ContractInterfaces.ts on lines 3809..3814
source/libraries/ContractInterfaces.ts on lines 4040..4045
source/libraries/ContractInterfaces.ts on lines 4131..4136
source/libraries/ContractInterfaces.ts on lines 4264..4269
source/libraries/ContractInterfaces.ts on lines 4404..4409
source/libraries/ContractInterfaces.ts on lines 4523..4528
source/libraries/ContractInterfaces.ts on lines 4607..4612
source/libraries/ContractInterfaces.ts on lines 4712..4717
source/libraries/ContractInterfaces.ts on lines 4873..4878
source/libraries/ContractInterfaces.ts on lines 4929..4934
source/libraries/ContractInterfaces.ts on lines 6084..6089

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

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

        public withdrawInEmergency_ = async( options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[],"name":"withdrawInEmergency","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 61 other locations - About 5 hrs to fix
source/libraries/ContractInterfaces.ts on lines 281..286
source/libraries/ContractInterfaces.ts on lines 743..748
source/libraries/ContractInterfaces.ts on lines 764..769
source/libraries/ContractInterfaces.ts on lines 792..797
source/libraries/ContractInterfaces.ts on lines 799..804
source/libraries/ContractInterfaces.ts on lines 939..944
source/libraries/ContractInterfaces.ts on lines 960..965
source/libraries/ContractInterfaces.ts on lines 1002..1007
source/libraries/ContractInterfaces.ts on lines 1219..1224
source/libraries/ContractInterfaces.ts on lines 1310..1315
source/libraries/ContractInterfaces.ts on lines 1443..1448
source/libraries/ContractInterfaces.ts on lines 1625..1630
source/libraries/ContractInterfaces.ts on lines 2115..2120
source/libraries/ContractInterfaces.ts on lines 2143..2148
source/libraries/ContractInterfaces.ts on lines 2178..2183
source/libraries/ContractInterfaces.ts on lines 2192..2197
source/libraries/ContractInterfaces.ts on lines 2227..2232
source/libraries/ContractInterfaces.ts on lines 2290..2295
source/libraries/ContractInterfaces.ts on lines 2409..2414
source/libraries/ContractInterfaces.ts on lines 2619..2624
source/libraries/ContractInterfaces.ts on lines 2682..2687
source/libraries/ContractInterfaces.ts on lines 2794..2799
source/libraries/ContractInterfaces.ts on lines 2871..2876
source/libraries/ContractInterfaces.ts on lines 2892..2897
source/libraries/ContractInterfaces.ts on lines 2913..2918
source/libraries/ContractInterfaces.ts on lines 3004..3009
source/libraries/ContractInterfaces.ts on lines 3018..3023
source/libraries/ContractInterfaces.ts on lines 3032..3037
source/libraries/ContractInterfaces.ts on lines 3046..3051
source/libraries/ContractInterfaces.ts on lines 3060..3065
source/libraries/ContractInterfaces.ts on lines 3074..3079
source/libraries/ContractInterfaces.ts on lines 3116..3121
source/libraries/ContractInterfaces.ts on lines 3130..3135
source/libraries/ContractInterfaces.ts on lines 3144..3149
source/libraries/ContractInterfaces.ts on lines 3193..3198
source/libraries/ContractInterfaces.ts on lines 3221..3226
source/libraries/ContractInterfaces.ts on lines 3249..3254
source/libraries/ContractInterfaces.ts on lines 3340..3345
source/libraries/ContractInterfaces.ts on lines 3389..3394
source/libraries/ContractInterfaces.ts on lines 3417..3422
source/libraries/ContractInterfaces.ts on lines 3431..3436
source/libraries/ContractInterfaces.ts on lines 3515..3520
source/libraries/ContractInterfaces.ts on lines 3543..3548
source/libraries/ContractInterfaces.ts on lines 3557..3562
source/libraries/ContractInterfaces.ts on lines 3648..3653
source/libraries/ContractInterfaces.ts on lines 3662..3667
source/libraries/ContractInterfaces.ts on lines 3669..3674
source/libraries/ContractInterfaces.ts on lines 3697..3702
source/libraries/ContractInterfaces.ts on lines 3753..3758
source/libraries/ContractInterfaces.ts on lines 3767..3772
source/libraries/ContractInterfaces.ts on lines 3809..3814
source/libraries/ContractInterfaces.ts on lines 4040..4045
source/libraries/ContractInterfaces.ts on lines 4131..4136
source/libraries/ContractInterfaces.ts on lines 4264..4269
source/libraries/ContractInterfaces.ts on lines 4404..4409
source/libraries/ContractInterfaces.ts on lines 4523..4528
source/libraries/ContractInterfaces.ts on lines 4607..4612
source/libraries/ContractInterfaces.ts on lines 4712..4717
source/libraries/ContractInterfaces.ts on lines 4873..4878
source/libraries/ContractInterfaces.ts on lines 4929..4934
source/libraries/ContractInterfaces.ts on lines 6084..6089

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

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

        public designatedReporterWasCorrect_ = async( options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[],"name":"designatedReporterWasCorrect","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 61 other locations - About 5 hrs to fix
source/libraries/ContractInterfaces.ts on lines 281..286
source/libraries/ContractInterfaces.ts on lines 743..748
source/libraries/ContractInterfaces.ts on lines 764..769
source/libraries/ContractInterfaces.ts on lines 792..797
source/libraries/ContractInterfaces.ts on lines 799..804
source/libraries/ContractInterfaces.ts on lines 939..944
source/libraries/ContractInterfaces.ts on lines 960..965
source/libraries/ContractInterfaces.ts on lines 1002..1007
source/libraries/ContractInterfaces.ts on lines 1219..1224
source/libraries/ContractInterfaces.ts on lines 1310..1315
source/libraries/ContractInterfaces.ts on lines 1443..1448
source/libraries/ContractInterfaces.ts on lines 1625..1630
source/libraries/ContractInterfaces.ts on lines 2115..2120
source/libraries/ContractInterfaces.ts on lines 2143..2148
source/libraries/ContractInterfaces.ts on lines 2178..2183
source/libraries/ContractInterfaces.ts on lines 2192..2197
source/libraries/ContractInterfaces.ts on lines 2227..2232
source/libraries/ContractInterfaces.ts on lines 2290..2295
source/libraries/ContractInterfaces.ts on lines 2360..2365
source/libraries/ContractInterfaces.ts on lines 2409..2414
source/libraries/ContractInterfaces.ts on lines 2619..2624
source/libraries/ContractInterfaces.ts on lines 2682..2687
source/libraries/ContractInterfaces.ts on lines 2794..2799
source/libraries/ContractInterfaces.ts on lines 2871..2876
source/libraries/ContractInterfaces.ts on lines 2892..2897
source/libraries/ContractInterfaces.ts on lines 2913..2918
source/libraries/ContractInterfaces.ts on lines 3004..3009
source/libraries/ContractInterfaces.ts on lines 3018..3023
source/libraries/ContractInterfaces.ts on lines 3032..3037
source/libraries/ContractInterfaces.ts on lines 3046..3051
source/libraries/ContractInterfaces.ts on lines 3060..3065
source/libraries/ContractInterfaces.ts on lines 3074..3079
source/libraries/ContractInterfaces.ts on lines 3116..3121
source/libraries/ContractInterfaces.ts on lines 3144..3149
source/libraries/ContractInterfaces.ts on lines 3193..3198
source/libraries/ContractInterfaces.ts on lines 3221..3226
source/libraries/ContractInterfaces.ts on lines 3249..3254
source/libraries/ContractInterfaces.ts on lines 3340..3345
source/libraries/ContractInterfaces.ts on lines 3389..3394
source/libraries/ContractInterfaces.ts on lines 3417..3422
source/libraries/ContractInterfaces.ts on lines 3431..3436
source/libraries/ContractInterfaces.ts on lines 3515..3520
source/libraries/ContractInterfaces.ts on lines 3543..3548
source/libraries/ContractInterfaces.ts on lines 3557..3562
source/libraries/ContractInterfaces.ts on lines 3648..3653
source/libraries/ContractInterfaces.ts on lines 3662..3667
source/libraries/ContractInterfaces.ts on lines 3669..3674
source/libraries/ContractInterfaces.ts on lines 3697..3702
source/libraries/ContractInterfaces.ts on lines 3753..3758
source/libraries/ContractInterfaces.ts on lines 3767..3772
source/libraries/ContractInterfaces.ts on lines 3809..3814
source/libraries/ContractInterfaces.ts on lines 4040..4045
source/libraries/ContractInterfaces.ts on lines 4131..4136
source/libraries/ContractInterfaces.ts on lines 4264..4269
source/libraries/ContractInterfaces.ts on lines 4404..4409
source/libraries/ContractInterfaces.ts on lines 4523..4528
source/libraries/ContractInterfaces.ts on lines 4607..4612
source/libraries/ContractInterfaces.ts on lines 4712..4717
source/libraries/ContractInterfaces.ts on lines 4873..4878
source/libraries/ContractInterfaces.ts on lines 4929..4934
source/libraries/ContractInterfaces.ts on lines 6084..6089

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

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

        public getInitialized_ = async( options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":true,"inputs":[],"name":"getInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"};
            const result = await this.localCall(abi, [], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 61 other locations - About 5 hrs to fix
source/libraries/ContractInterfaces.ts on lines 281..286
source/libraries/ContractInterfaces.ts on lines 743..748
source/libraries/ContractInterfaces.ts on lines 764..769
source/libraries/ContractInterfaces.ts on lines 792..797
source/libraries/ContractInterfaces.ts on lines 799..804
source/libraries/ContractInterfaces.ts on lines 939..944
source/libraries/ContractInterfaces.ts on lines 960..965
source/libraries/ContractInterfaces.ts on lines 1002..1007
source/libraries/ContractInterfaces.ts on lines 1219..1224
source/libraries/ContractInterfaces.ts on lines 1310..1315
source/libraries/ContractInterfaces.ts on lines 1443..1448
source/libraries/ContractInterfaces.ts on lines 1625..1630
source/libraries/ContractInterfaces.ts on lines 2115..2120
source/libraries/ContractInterfaces.ts on lines 2143..2148
source/libraries/ContractInterfaces.ts on lines 2178..2183
source/libraries/ContractInterfaces.ts on lines 2192..2197
source/libraries/ContractInterfaces.ts on lines 2227..2232
source/libraries/ContractInterfaces.ts on lines 2290..2295
source/libraries/ContractInterfaces.ts on lines 2360..2365
source/libraries/ContractInterfaces.ts on lines 2409..2414
source/libraries/ContractInterfaces.ts on lines 2619..2624
source/libraries/ContractInterfaces.ts on lines 2682..2687
source/libraries/ContractInterfaces.ts on lines 2794..2799
source/libraries/ContractInterfaces.ts on lines 2871..2876
source/libraries/ContractInterfaces.ts on lines 2892..2897
source/libraries/ContractInterfaces.ts on lines 2913..2918
source/libraries/ContractInterfaces.ts on lines 3004..3009
source/libraries/ContractInterfaces.ts on lines 3018..3023
source/libraries/ContractInterfaces.ts on lines 3032..3037
source/libraries/ContractInterfaces.ts on lines 3046..3051
source/libraries/ContractInterfaces.ts on lines 3060..3065
source/libraries/ContractInterfaces.ts on lines 3074..3079
source/libraries/ContractInterfaces.ts on lines 3116..3121
source/libraries/ContractInterfaces.ts on lines 3130..3135
source/libraries/ContractInterfaces.ts on lines 3144..3149
source/libraries/ContractInterfaces.ts on lines 3193..3198
source/libraries/ContractInterfaces.ts on lines 3221..3226
source/libraries/ContractInterfaces.ts on lines 3340..3345
source/libraries/ContractInterfaces.ts on lines 3389..3394
source/libraries/ContractInterfaces.ts on lines 3417..3422
source/libraries/ContractInterfaces.ts on lines 3431..3436
source/libraries/ContractInterfaces.ts on lines 3515..3520
source/libraries/ContractInterfaces.ts on lines 3543..3548
source/libraries/ContractInterfaces.ts on lines 3557..3562
source/libraries/ContractInterfaces.ts on lines 3648..3653
source/libraries/ContractInterfaces.ts on lines 3662..3667
source/libraries/ContractInterfaces.ts on lines 3669..3674
source/libraries/ContractInterfaces.ts on lines 3697..3702
source/libraries/ContractInterfaces.ts on lines 3753..3758
source/libraries/ContractInterfaces.ts on lines 3767..3772
source/libraries/ContractInterfaces.ts on lines 3809..3814
source/libraries/ContractInterfaces.ts on lines 4040..4045
source/libraries/ContractInterfaces.ts on lines 4131..4136
source/libraries/ContractInterfaces.ts on lines 4264..4269
source/libraries/ContractInterfaces.ts on lines 4404..4409
source/libraries/ContractInterfaces.ts on lines 4523..4528
source/libraries/ContractInterfaces.ts on lines 4607..4612
source/libraries/ContractInterfaces.ts on lines 4712..4717
source/libraries/ContractInterfaces.ts on lines 4873..4878
source/libraries/ContractInterfaces.ts on lines 4929..4934
source/libraries/ContractInterfaces.ts on lines 6084..6089

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

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

        public fork_ = async( options?: { sender?: string }): Promise<boolean> => {
            options = options || {};
            const abi: AbiFunction = {"constant":false,"inputs":[],"name":"fork","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
            const result = await this.localCall(abi, [], options.sender);
            return <boolean>result[0];
Severity: Major
Found in source/libraries/ContractInterfaces.ts and 61 other locations - About 5 hrs to fix
source/libraries/ContractInterfaces.ts on lines 281..286
source/libraries/ContractInterfaces.ts on lines 743..748
source/libraries/ContractInterfaces.ts on lines 764..769
source/libraries/ContractInterfaces.ts on lines 792..797
source/libraries/ContractInterfaces.ts on lines 799..804
source/libraries/ContractInterfaces.ts on lines 939..944
source/libraries/ContractInterfaces.ts on lines 960..965
source/libraries/ContractInterfaces.ts on lines 1002..1007
source/libraries/ContractInterfaces.ts on lines 1219..1224
source/libraries/ContractInterfaces.ts on lines 1310..1315
source/libraries/ContractInterfaces.ts on lines 1443..1448
source/libraries/ContractInterfaces.ts on lines 1625..1630
source/libraries/ContractInterfaces.ts on lines 2115..2120
source/libraries/ContractInterfaces.ts on lines 2143..2148
source/libraries/ContractInterfaces.ts on lines 2178..2183
source/libraries/ContractInterfaces.ts on lines 2192..2197
source/libraries/ContractInterfaces.ts on lines 2227..2232
source/libraries/ContractInterfaces.ts on lines 2290..2295
source/libraries/ContractInterfaces.ts on lines 2360..2365
source/libraries/ContractInterfaces.ts on lines 2409..2414
source/libraries/ContractInterfaces.ts on lines 2619..2624
source/libraries/ContractInterfaces.ts on lines 2682..2687
source/libraries/ContractInterfaces.ts on lines 2794..2799
source/libraries/ContractInterfaces.ts on lines 2871..2876
source/libraries/ContractInterfaces.ts on lines 2892..2897
source/libraries/ContractInterfaces.ts on lines 2913..2918
source/libraries/ContractInterfaces.ts on lines 3004..3009
source/libraries/ContractInterfaces.ts on lines 3018..3023
source/libraries/ContractInterfaces.ts on lines 3032..3037
source/libraries/ContractInterfaces.ts on lines 3046..3051
source/libraries/ContractInterfaces.ts on lines 3060..3065
source/libraries/ContractInterfaces.ts on lines 3074..3079
source/libraries/ContractInterfaces.ts on lines 3116..3121
source/libraries/ContractInterfaces.ts on lines 3130..3135
source/libraries/ContractInterfaces.ts on lines 3144..3149
source/libraries/ContractInterfaces.ts on lines 3193..3198
source/libraries/ContractInterfaces.ts on lines 3221..3226
source/libraries/ContractInterfaces.ts on lines 3249..3254
source/libraries/ContractInterfaces.ts on lines 3340..3345
source/libraries/ContractInterfaces.ts on lines 3389..3394
source/libraries/ContractInterfaces.ts on lines 3417..3422
source/libraries/ContractInterfaces.ts on lines 3431..3436
source/libraries/ContractInterfaces.ts on lines 3515..3520
source/libraries/ContractInterfaces.ts on lines 3543..3548
source/libraries/ContractInterfaces.ts on lines 3557..3562
source/libraries/ContractInterfaces.ts on lines 3648..3653
source/libraries/ContractInterfaces.ts on lines 3662..3667
source/libraries/ContractInterfaces.ts on lines 3669..3674
source/libraries/ContractInterfaces.ts on lines 3697..3702
source/libraries/ContractInterfaces.ts on lines 3753..3758
source/libraries/ContractInterfaces.ts on lines 3767..3772
source/libraries/ContractInterfaces.ts on lines 3809..3814
source/libraries/ContractInterfaces.ts on lines 4040..4045
source/libraries/ContractInterfaces.ts on lines 4131..4136
source/libraries/ContractInterfaces.ts on lines 4264..4269
source/libraries/ContractInterfaces.ts on lines 4523..4528
source/libraries/ContractInterfaces.ts on lines 4607..4612
source/libraries/ContractInterfaces.ts on lines 4712..4717
source/libraries/ContractInterfaces.ts on lines 4873..4878
source/libraries/ContractInterfaces.ts on lines 4929..4934
source/libraries/ContractInterfaces.ts on lines 6084..6089

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

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

InitialReporter has 40 functions (exceeds 20 allowed). Consider refactoring.
Open

    export class InitialReporter extends Controlled {
        public constructor(connector: Connector, accountManager: AccountManager, address: string, defaultGasPrice: BN) {
            super(connector, accountManager, address, defaultGasPrice);
        }

Severity: Minor
Found in source/libraries/ContractInterfaces.ts - About 5 hrs to fix

    ShareToken has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

        export class ShareToken extends Controlled {
            public constructor(connector: Connector, accountManager: AccountManager, address: string, defaultGasPrice: BN) {
                super(connector, accountManager, address, defaultGasPrice);
            }
    
    
    Severity: Minor
    Found in source/libraries/ContractInterfaces.ts - About 5 hrs to fix

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

                  const abi: AbiFunction = {"constant":false,"inputs":[{"name":"_market","type":"address"},{"name":"_outcome","type":"uint256"},{"name":"_numberOfShares","type":"uint256"}],"name":"divideUpWinnings","outputs":[{"name":"_proceeds","type":"uint256"},{"name":"_shareHolderShare","type":"uint256"},{"name":"_creatorShare","type":"uint256"},{"name":"_reporterShare","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
      Severity: Major
      Found in source/libraries/ContractInterfaces.ts and 1 other location - About 5 hrs to fix
      source/libraries/ContractInterfaces.ts on lines 5260..5260

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

      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":"_market","type":"address"},{"name":"_outcome","type":"uint256"},{"name":"_numberOfShares","type":"uint256"}],"name":"divideUpWinnings","outputs":[{"name":"_proceeds","type":"uint256"},{"name":"_shareHolderShare","type":"uint256"},{"name":"_creatorShare","type":"uint256"},{"name":"_reporterShare","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"};
      Severity: Major
      Found in source/libraries/ContractInterfaces.ts and 1 other location - About 5 hrs to fix
      source/libraries/ContractInterfaces.ts on lines 5267..5267

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

      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

      Orders has 37 functions (exceeds 20 allowed). Consider refactoring.
      Open

          export class Orders extends Controlled {
              public constructor(connector: Connector, accountManager: AccountManager, address: string, defaultGasPrice: BN) {
                  super(connector, accountManager, address, defaultGasPrice);
              }
      
      
      Severity: Minor
      Found in source/libraries/ContractInterfaces.ts - About 4 hrs to fix

        Cash has 33 functions (exceeds 20 allowed). Consider refactoring.
        Open

            export class Cash extends Controlled {
                public constructor(connector: Connector, accountManager: AccountManager, address: string, defaultGasPrice: BN) {
                    super(connector, accountManager, address, defaultGasPrice);
                }
        
        
        Severity: Minor
        Found in source/libraries/ContractInterfaces.ts - About 4 hrs to fix

          File ContractDeployer.ts has 331 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import BN = require('bn.js');
          import { hash } from 'crypto-promise';
          import { exists, readFile, writeFile } from "async-file";
          import { exec } from 'child_process';
          import { encodeParams } from 'ethjs-abi';
          Severity: Minor
          Found in source/libraries/ContractDeployer.ts - About 3 hrs to fix

            ContractDeployer has 31 functions (exceeds 20 allowed). Consider refactoring.
            Open

            export class ContractDeployer {
                private readonly accountManager: AccountManager;
                private readonly configuration: DeployerConfiguration;
                private readonly connector: Connector;
                private readonly contracts: Contracts;
            Severity: Minor
            Found in source/libraries/ContractDeployer.ts - About 3 hrs to fix

              FeeToken has 30 functions (exceeds 20 allowed). Consider refactoring.
              Open

                  export class FeeToken extends Controlled {
                      public constructor(connector: Connector, accountManager: AccountManager, address: string, defaultGasPrice: BN) {
                          super(connector, accountManager, address, defaultGasPrice);
                      }
              
              
              Severity: Minor
              Found in source/libraries/ContractInterfaces.ts - About 3 hrs to fix

                LegacyReputationToken has 28 functions (exceeds 20 allowed). Consider refactoring.
                Open

                    export class LegacyReputationToken extends Contract {
                        public constructor(connector: Connector, accountManager: AccountManager, address: string, defaultGasPrice: BN) {
                            super(connector, accountManager, address, defaultGasPrice);
                        }
                
                
                Severity: Minor
                Found in source/libraries/ContractInterfaces.ts - About 3 hrs to fix

                  Function filterCompilerOutput has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private filterCompilerOutput(compilerOutput: CompilerOutput): CompilerOutput {
                          const result: CompilerOutput = { contracts: {} };
                          for (let relativeFilePath in compilerOutput.contracts) {
                              for (let contractName in compilerOutput.contracts[relativeFilePath]) {
                                  // don't include libraries
                  Severity: Minor
                  Found in source/libraries/ContractCompiler.ts - About 3 hrs 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 2 locations. Consider refactoring.
                  Open

                      public async approveLegacyRep(spender: string, amount: BN): Promise<void> {
                          const legacyRepContract = await this.contractDeployer.getContract("LegacyReputationToken");
                          const legacyRep = new LegacyReputationToken(this.connector, this.accountManager, legacyRepContract.address, TestFixture.GAS_PRICE);
                          await legacyRep.approve(spender, amount);
                          return;
                  Severity: Major
                  Found in source/tests-integration/TestFixture.ts and 1 other location - About 3 hrs to fix
                  source/tests-integration/TestFixture.ts on lines 258..263

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

                  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 async transferLegacyRep(to: string, amount: BN): Promise<void> {
                          const legacyRepContract = await this.contractDeployer.getContract("LegacyReputationToken");
                          const legacyRep = new LegacyReputationToken(this.connector, this.accountManager, legacyRepContract.address, TestFixture.GAS_PRICE);
                          await legacyRep.transfer(to, amount);
                          return;
                  Severity: Major
                  Found in source/tests-integration/TestFixture.ts and 1 other location - About 3 hrs to fix
                  source/tests-integration/TestFixture.ts on lines 265..270

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

                  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