AugurProject/augur-ui

View on GitHub

Showing 1,757 of 1,757 total issues

Function createCustomPropType has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function createCustomPropType(isRequired) {
  // The factory returns a custom prop type
  return function customPropType(props, propName, componentName) {
    const prop = props[propName];
    if (prop == null) {
Severity: Minor
Found in src/utils/custom-prop-types.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function isChecksumAddress has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function isChecksumAddress(address) {
  // Check each case
  const formattedAddress = address.replace("0x", "");
  const addressHash = augur.rpc.sha3(formattedAddress.toLowerCase());
  for (let i = 0; i < 40; i++) {
Severity: Minor
Found in src/modules/auth/helpers/is-address.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function checkIfMainnet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const checkIfMainnet = (callback = logError) => dispatch => {
  dispatch(
    getAugurNodeNetworkId((err, augurNodeNetworkId) => {
      if (err) return callback(err);
      if (augurNodeNetworkId === "1") {
Severity: Minor
Found in src/modules/app/actions/check-if-mainnet.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function loadBidsAsks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const loadBidsAsks = (marketId, callback = logError) => (
  dispatch,
  getState
) => {
  const { marketsData } = getState();
Severity: Minor
Found in src/modules/orders/actions/load-bids-asks.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function getOpenAskShares has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export function getOpenAskShares(account, outcomeId, askOrders) {
  if (!account || !askOrders) return ZERO;
  let order;
  let askShares = ZERO;
  const orderIds = Object.keys(askOrders);
Severity: Minor
Found in src/modules/orders/selectors/positions-plus-asks.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function callMethod has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const callMethod = (method, amount, address, estimateGas = false, callback) => (
  dispatch,
  getState
) => {
  const { loginAccount } = getState();
Severity: Minor
Found in src/modules/reports/actions/participation-tokens-management.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function loginWithMetaMask has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const loginWithMetaMask = (callback = logError) => dispatch => {
  const failure = () => callback("NOT_SIGNED_IN");
  const success = account => {
    // make sure we actually have an account before succeeding...
    if (!account) return failure();
Severity: Minor
Found in src/modules/auth/actions/login-with-metamask.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function selectOpenOrdersMarkets has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  markets => {
    const openOrdersMarkets = [];
    if (markets) {
      const numMarkets = markets.length;
      for (let i = 0; i < numMarkets; ++i) {
Severity: Minor
Found in src/modules/orders/selectors/open-orders.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function selectPositionsPlusAsks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  (address, positions, orderBooks) => {
    if (!positions) return null;
    const adjustedMarkets = Object.keys(positions);
    const numAdjustedMarkets = adjustedMarkets.length;
    const positionsPlusAsks = {};
Severity: Minor
Found in src/modules/orders/selectors/positions-plus-asks.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function reduceSharesCountByPrice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function reduceSharesCountByPrice(aggregateOrdersPerPrice, order) {
  if (
    order &&
    !isNaN(order.fullPrecisionPrice) &&
    !isNaN(order.fullPrecisionAmount)
Severity: Minor
Found in src/modules/orders/helpers/select-order-book.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function migrateMarketThroughFork has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const migrateMarketThroughFork = (
  marketId,
  estimateGas = false,
  callback = logError
) => (dispatch, getState) => {
Severity: Minor
Found in src/modules/forking/actions/migrate-market-through-fork.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function loadMarketsDisputeInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const loadMarketsDisputeInfo = (marketIds, callback = logError) => (
  dispatch,
  getState
) => {
  dispatch(
Severity: Minor
Found in src/modules/markets/actions/load-markets-info.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function changeMenu has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  changeMenu(nextBasePath) {
    const { isLogged } = this.props;
    const oldType = this.state.currentInnerNavType
      ? navTypes[this.state.currentBasePath]
      : this.state.currentInnerNavType;
Severity: Minor
Found in src/modules/app/components/app/app.jsx - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function default has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function(accountPositions = DEFAULT_STATE, { type, data }) {
  switch (type) {
    case UPDATE_ACCOUNT_POSITIONS_DATA: {
      const { positionData, marketId } = data;
      if (positionData) {
Severity: Minor
Found in src/modules/positions/reducers/account-positions.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function loadPriceHistory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const loadPriceHistory = (options = {}, callback = logError) => (
  dispatch,
  getState
) => {
  augur.markets.getMarketPriceHistory(options, (err, priceHistory) => {
Severity: Minor
Found in src/modules/markets/actions/price-history-management.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function buildSearchString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const buildSearchString = (keywords, tags) => {
  const MIN_KEYWORDS_LENGTH = 1;
  const propertyTranslation = [
    { find: "title:", replace: "shortDescription:" },
    { find: "details:", replace: "longDescription:" },
Severity: Minor
Found in src/modules/markets/selectors/build-search-string.js - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function mapStateToProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const mapStateToProps = (state, ownProps) => {
  const { newMarket, loginAccount } = state;

  const selectedOutcome = ownProps.selectedOutcome.toString();
  const orderBook = formatOrderbook(newMarket.orderBook[selectedOutcome] || []);

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

  constructor(props) {
    super(props);
    // prioritize ethereumNode connections
    let ethereumNode = "";
    if (props.env["ethereum-node"]) {
Severity: Minor
Found in src/modules/modal/components/modal-network-connect.jsx - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function MarketPortfolioCardFooter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const MarketPortfolioCardFooter = ({
  currentTimestamp,
  finalizationTime,
  linkType,
  unclaimedForkEth,

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function validateForm has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  validateForm(property, rawValue) {
    const { updateState } = this.props;
    // since the order changed by user action, make sure we can place orders.
    // updateState('doNotCreateOrders', false)
    let value = rawValue;
Severity: Minor
Found in src/modules/trading/components/trading--form/trading--form.jsx - About 25 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Severity
Category
Status
Source
Language