theQRL/block-explorer

View on GitHub

Showing 158 of 158 total issues

Function block has 108 lines of code (exceeds 25 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: Major
Found in imports/startup/server/index.js - About 4 hrs to fix

    Function helpersaddressTransactions has 105 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const helpersaddressTransactions = (response) => {
      const output = []
      // console.log(response)
      _.each(response.transactions_detail, (tx) => {
        const txEdited = tx
    Severity: Major
    Found in imports/startup/server/index.js - About 4 hrs to fix

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

          try {
            const x = LocalStore.get('theme')
            if (x === 'dark') {
              LocalStore.set('theme', 'light')
              updateStyleSheet('light')
      Severity: Major
      Found in imports/ui/layouts/body/body.js and 1 other location - About 4 hrs to fix
      imports/ui/mobile/mobile.js on lines 26..47

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

      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

          try {
            const x = LocalStore.get('theme')
            if (x === 'dark') {
              LocalStore.set('theme', 'light')
              updateStyleSheet('light')
      Severity: Major
      Found in imports/ui/mobile/mobile.js and 1 other location - About 4 hrs to fix
      imports/ui/layouts/body/body.js on lines 66..87

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      export const getObject = (request, callback) => {
        try {
          qrlApi('GetObject', request, (error, response) => {
            if (error) {
              const myError = errorCallback(error, 'Cannot access API/GetObject', '**ERROR/GetObject**')
      Severity: Major
      Found in imports/startup/server/index.js and 2 other locations - About 3 hrs to fix
      imports/startup/server/index.js on lines 604..619
      imports/startup/server/index.js on lines 621..636

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      export const getTransactionsByAddress = (request, callback) => {
        try {
          qrlApi('GetTransactionsByAddress', request, (error, response) => {
            if (error) {
              const myError = errorCallback(error, 'Cannot access API/GetTransactionsByAddress', '**ERROR/GetTransactionsByAddress**')
      Severity: Major
      Found in imports/startup/server/index.js and 2 other locations - About 3 hrs to fix
      imports/startup/server/index.js on lines 587..602
      imports/startup/server/index.js on lines 621..636

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      export const getSlavesByAddress = (request, callback) => {
        try {
          qrlApi('GetSlavesByAddress', request, (error, response) => {
            if (error) {
              const myError = errorCallback(error, 'Cannot access API/GetSlavesByAddress', '**ERROR/GetSlavesByAddress**')
      Severity: Major
      Found in imports/startup/server/index.js and 2 other locations - About 3 hrs to fix
      imports/startup/server/index.js on lines 587..602
      imports/startup/server/index.js on lines 604..619

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      export const getLatestData = (request, callback) => {
        try {
          qrlApi('GetLatestData', request, (error, response) => {
            if (error) {
              const myError = errorCallback(error, 'Cannot access API/GetLatestData', '**ERROR/GetLatestData** ')
      Severity: Major
      Found in imports/startup/server/index.js and 2 other locations - About 3 hrs to fix
      imports/startup/server/index.js on lines 555..569
      imports/startup/server/index.js on lines 571..585

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      export const getStats = (request, callback) => {
        try {
          qrlApi('GetStats', request, (error, response) => {
            if (error) {
              const myError = errorCallback(error, 'Cannot access API/GetStats/a', '**ERROR/GetStats/a** ')
      Severity: Major
      Found in imports/startup/server/index.js and 2 other locations - About 3 hrs to fix
      imports/startup/server/index.js on lines 539..553
      imports/startup/server/index.js on lines 571..585

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      export const getPeersStat = (request, callback) => {
        try {
          qrlApi('GetPeersStat', request, (error, response) => {
            if (error) {
              const myError = errorCallback(error, 'Cannot access API/GetPeersStat/a', '**ERROR/GetPeersStat/a** ')
      Severity: Major
      Found in imports/startup/server/index.js and 2 other locations - About 3 hrs to fix
      imports/startup/server/index.js on lines 539..553
      imports/startup/server/index.js on lines 555..569

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

      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

      Function renderAddressBlock has 80 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const renderAddressBlock = () => {
        const aId = upperCaseFirst(FlowRouter.getParam('aId'))
        let tPage = FlowRouter.getParam('tPage')
        tPage = parseInt(tPage, 10)
        if (!tPage) { tPage = 1 }
      Severity: Major
      Found in imports/ui/components/address/address.js - About 3 hrs to fix

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

          'click .jsonclick': () => {
            if (!($('.json').html())) {
              const myJSON = Session.get('block').block
              const formatter = new JSONFormatter(myJSON)
              $('.json').html(formatter.render())
        Severity: Major
        Found in imports/ui/components/block/block.js and 1 other location - About 3 hrs to fix
        imports/ui/components/tx/tx.js on lines 419..426

        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

          'click .jsonclick': () => {
            if (!($('.json').html())) {
              const myJSON = Session.get('txhash').transaction
              const formatter = new JSONFormatter(myJSON)
              $('.json').html(formatter.render())
        Severity: Major
        Found in imports/ui/components/tx/tx.js and 1 other location - About 3 hrs to fix
        imports/ui/components/block/block.js on lines 193..200

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

          providerName() {
            const { id } = this.explorer.nft
            let name = ''
            _.each(qrlNft.providers, (provider) => {
              if (provider.id === `0x${id}`) {
        Severity: Major
        Found in imports/ui/components/tx/tx.js and 3 other locations - About 3 hrs to fix
        imports/ui/components/lasttx/lasttx.js on lines 92..101
        imports/ui/components/lasttx/lasttx.js on lines 102..111
        imports/ui/components/tx/tx.js on lines 341..350

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

          providerURL() {
            const { id } = this.explorer.nft
            let url = ''
            _.each(qrlNft.providers, (provider) => {
              if (provider.id === `0x${id}`) {
        Severity: Major
        Found in imports/ui/components/lasttx/lasttx.js and 3 other locations - About 3 hrs to fix
        imports/ui/components/lasttx/lasttx.js on lines 102..111
        imports/ui/components/tx/tx.js on lines 341..350
        imports/ui/components/tx/tx.js on lines 351..360

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

          providerName() {
            const { id } = this.explorer.nft
            let name = ''
            _.each(qrlNft.providers, (provider) => {
              if (provider.id === `0x${id}`) {
        Severity: Major
        Found in imports/ui/components/lasttx/lasttx.js and 3 other locations - About 3 hrs to fix
        imports/ui/components/lasttx/lasttx.js on lines 92..101
        imports/ui/components/tx/tx.js on lines 341..350
        imports/ui/components/tx/tx.js on lines 351..360

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

          providerURL() {
            const { id } = this.explorer.nft
            let url = ''
            _.each(qrlNft.providers, (provider) => {
              if (provider.id === `0x${id}`) {
        Severity: Major
        Found in imports/ui/components/tx/tx.js and 3 other locations - About 3 hrs to fix
        imports/ui/components/lasttx/lasttx.js on lines 92..101
        imports/ui/components/lasttx/lasttx.js on lines 102..111
        imports/ui/components/tx/tx.js on lines 351..360

        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

        Function renderChart has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function renderChart() {
          // Get Chart data from Mongo
          const chartLineData = homechart.findOne()
        
          // Only render chart if we get valid data back
        Severity: Major
        Found in imports/ui/pages/home/home.js - About 3 hrs to fix

          Function getTokenBalances has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const getTokenBalances = (getAddress, callback) => {
            const request = {
              address: anyAddressToRaw(getAddress),
            }
          
          
          Severity: Major
          Found in imports/ui/components/address/address.js - About 3 hrs to fix

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

              theme() {
                try {
                  const x = LocalStore.get('theme')
                  if (x === 'dark') {
                    return 'sun'
            Severity: Major
            Found in imports/ui/mobile/mobile.js and 1 other location - About 3 hrs to fix
            imports/ui/layouts/body/body.js on lines 110..125

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

            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