theQRL/block-explorer

View on GitHub

Showing 51 of 158 total issues

Function render_addr_to has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  render_addr_to() {
    if (this.transactionType === 'coinbase') {
      return hexOrB32(this.coinbase.addr_to)
    }
    if (this.transactionType === 'transfer') {
Severity: Minor
Found in imports/ui/components/block/block.js - About 35 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 getFullAddressState has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const getFullAddressState = (request, callback) => {
  try {
    qrlApi('GetAddressState', request, (error, response) => {
      if (error) {
        const myError = errorCallback(error, 'Cannot access API/GetOptimizedAddressState', '**ERROR/getAddressState** ')
Severity: Minor
Found in imports/startup/server/index.js - About 35 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 block has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  block(blockId) {
    check(blockId, Number)
    console.log(`block Method called for: ${blockId}`)
    if (!(Match.test(blockId, Number)) || (Number.isNaN(blockId))) {
      const errorCode = 400
Severity: Minor
Found in imports/startup/server/index.js - About 35 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 color has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  color() {
    let ret = ''
    if (this.found) {
      if (this.transaction.tx.transactionType === 'coinbase') {
        ret = 'teal'
Severity: Minor
Found in imports/ui/components/address/address.js - About 35 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

Avoid too many return statements within this function.
Open

      return `${this.transfer_token.totalOutputs} addresses`
Severity: Major
Found in imports/ui/components/block/block.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return ''
    Severity: Major
    Found in imports/ui/components/block/block.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return ''
      Severity: Major
      Found in imports/ui/components/block/block.js - About 30 mins to fix

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

        const identifySearch = (str) => {
          let adjstr = str.trim()
          if (adjstr.charAt(0) === 'q') {
            adjstr = `Q${adjstr.substr(1, adjstr.length - 1)}`
            $('#mainSearch').val(adjstr)
        Severity: Minor
        Found in imports/ui/components/search/search.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 click .themeToggle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          'click .themeToggle': () => {
            try {
              const x = LocalStore.get('theme')
              if (x === 'dark') {
                LocalStore.set('theme', 'light')
        Severity: Minor
        Found in imports/ui/mobile/mobile.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 renderBlockBlock has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        const renderBlockBlock = (blockId) => {
          Meteor.call('block', blockId, (err, res) => {
            // The method call sets the Session variable to the callback value
            if (err) {
              Session.set('block', {
        Severity: Minor
        Found in imports/ui/components/block/block.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 click .themeToggle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

          'click .themeToggle': () => {
            try {
              const x = LocalStore.get('theme')
              if (x === 'dark') {
                LocalStore.set('theme', 'light')
        Severity: Minor
        Found in imports/ui/layouts/body/body.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

        Severity
        Category
        Status
        Source
        Language