Showing 1,757 of 1,757 total issues
Similar blocks of code found in 4 locations. Consider refactoring. Open
export const toReporting = async () => {
const url = `${process.env.AUGUR_URL}`;
await page.goto(url.concat("#/reporting-report-markets"));
};
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 60.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 4 locations. Consider refactoring. Open
export const toPortfolio = async () => {
const url = `${process.env.AUGUR_URL}`;
await page.goto(url.concat("#/my-positions"));
};
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 60.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function handleRelayTransaction
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const handleRelayTransaction = tx => (dispatch, getState) => {
if (tx && tx.response && tx.data) {
const { hash, type } = tx;
if (!hash) return console.error("uncaught relayed transaction", tx);
const { loginAccount, transactionsData } = getState();
Function toggleTag
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
const toggleTag = (tag, location, history) => () => {
let searchParams = parseQuery(location.search);
if (
searchParams[TAGS_PARAM_NAME] == null ||
Function formatGroupedTransactions
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function formatGroupedTransactions(transactions) {
const formattedTransactions = transactions
.map(transaction => formatTransaction(transaction))
.sort(
(a, b) =>
Function default
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(outcomesData = DEFAULT_STATE, action) {
switch (action.type) {
case UPDATE_MARKETS_DATA:
return {
...outcomesData,
Function onDerivationPathChange
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async onDerivationPathChange(derivationPaths, pageNumber = 1) {
const transport = await TransportU2F.create();
const ledgerEthereum = new Eth(transport);
const appConfiguration = await ledgerEthereum.getAppConfiguration();
if (!appConfiguration.arbitraryDataEnabled) {
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
const { transactionPeriod } = props;
this.state = {
lowerBound: null,
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { userDefinedGasPrice, gasPriceSpeed, className } = this.props;
return (
<div className={classNames(Styles.GasPriceEdit, className)}>
Function constructor
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.snapConfig = {
scrollSnapDestination: "100% 0%",
Function render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { id, unclaimedCreatorFees, collectMarketCreatorFees } = this.props;
return (
<div className={Styles.MarketOutstandingReturns}>
Function createScalarMarket
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createScalarMarket = async () => {
// page.on('console', msg => console.log('PAGE LOG:', msg.text()));
const currentTimestamp: number = await page.evaluate(() =>
window.integrationHelpers.getCurrentTimestamp()
);
Function createPeriodPLSelector
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
(accountTrades, blockchain, outcomesData, currentTimestamp) => {
if (!accountTrades || !blockchain) return null;
const periodDate = new Date(
currentTimestamp - period * 24 * 60 * 60 * 1000
Function RewriteUrlParams
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const RewriteUrlParams = windowRef => BaseCmp => {
const WrapperCmp = props => {
const { location } = props;
const searchValues = parseQuery(location.search);
Function componentWillReceiveProps
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
componentWillReceiveProps(nextProps) {
const { isMobile, location, universe, blockchain } = this.props;
if (isMobile !== nextProps.isMobile) {
this.setState({
mobileMenuState: mobileMenuStates.CLOSED
Identical blocks of code found in 2 locations. Consider refactoring. Open
test(`market.outcomes[${i}].userOpenOrders`, () => {
expect(userOpenOrders).toBeDefined();
expect(Array.isArray(userOpenOrders)).toBe(true);
});
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
const actual = buildCreateMarket(
store.getState().newMarket,
false,
store.getState().universe,
store.getState().loginAccount,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
hideReadMore(e) {
if (this.readMore && !this.readMore.contains(event.target)) {
this.setState({ readMore: false });
}
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 3 locations. Consider refactoring. Open
const actual = buildCreateMarket(
store.getState().newMarket,
false,
store.getState().universe,
store.getState().loginAccount,
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
test(`should call the expected method`, () => {
const market = {
reportingState: constants.REPORTING_STATE.CROWDSOURCING_DISPUTE
};
expect(determineMarketLinkType(market, account)).toEqual(TYPE_DISPUTE);
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 59.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76