Privatix/dapp-gui

View on GitHub

Showing 5,602 of 5,602 total issues

File moment.js has 3163 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//! moment.js
//! version : 2.14.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
Severity: Major
Found in assets/js/moment.js - About 1 wk to fix

    File countries.ts has 1002 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export default [
      {
        id: 'AF',
        name: 'Afghanistan'
      },
    Severity: Major
    Found in src/utils/countries.ts - About 2 days to fix

      Function render has 362 lines of code (exceeds 40 allowed). Consider refactoring.
      Open

          render(){
              const { t, accounts, products, localSettings } = this.props;
              const { payload, account, gasPrice, blocked } = this.state;
      
              const selectProduct = <Select className='form-control'
      Severity: Major
      Found in src/agent/offerings/createOffering/index.tsx - About 1 day to fix

        File index.tsx has 740 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import * as React from 'react';
        import { connect } from 'react-redux';
        import { withRouter, RouteComponentProps } from 'react-router';
        import { WithTranslation, withTranslation, Trans } from 'react-i18next';
        import Select from 'react-select';
        Severity: Major
        Found in src/agent/offerings/createOffering/index.tsx - About 1 day to fix

          Function slimScroll has 294 lines of code (exceeds 40 allowed). Consider refactoring.
          Open

              slimScroll: function(options) {
          
                var defaults = {
          
                  // width in pixels of the visible scroll area
          Severity: Major
          Found in assets/js/jquery.slimscroll.js - About 1 day to fix

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

                                            <div className='form-group row'>
                                                <label className='col-2 col-form-label'>{t('MaxInactiveTime')}:<span className='text-danger'>*</span></label>
                                                <div className='col-6'>
                                                    <div className='input-group bootstrap-touchspin'>
                                                        <input type='text'
            Severity: Major
            Found in src/agent/offerings/createOffering/index.tsx and 1 other location - About 1 day to fix
            src/agent/offerings/createOffering/index.tsx on lines 660..681

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

            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

            class SelectByAgent extends React.Component<any,any> {
            
                render() {
            
                    const { t, agentHash, onChange } = this.props;
            Severity: Major
            Found in src/client/vpn_list/list/selectByAgent.tsx and 1 other location - About 1 day to fix
            src/client/vpn_list/list/selectByOffering.tsx on lines 6..33

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

            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

                                            <div className='form-group row'>
                                                <label className='col-2 col-form-label'>{t('MaxSuspendTime')}:<span className='text-danger'>*</span></label>
                                                <div className='col-6'>
                                                    <div className='input-group bootstrap-touchspin'>
                                                        <input type='text'
            Severity: Major
            Found in src/agent/offerings/createOffering/index.tsx and 1 other location - About 1 day to fix
            src/agent/offerings/createOffering/index.tsx on lines 682..703

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

            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

            class SelectByOffering extends React.Component<any,any> {
            
                render() {
            
                    const { t, offeringHash, onChange } = this.props;
            Severity: Major
            Found in src/client/vpn_list/list/selectByOffering.tsx and 1 other location - About 1 day to fix
            src/client/vpn_list/list/selectByAgent.tsx on lines 6..33

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

            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

            File notify.js has 574 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* Notify.js - http://notifyjs.com/ Copyright (c) 2015 MIT */
            (function (factory) {
                // UMD start
                // https://github.com/umdjs/umd/blob/master/jqueryPluginCommonjs.js
                if (typeof define === 'function' && define.amd) {
            Severity: Major
            Found in assets/js/plugins/notify.js - About 1 day to fix

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

                      return(
                          <div className='startingServiceWrap'>
                              <I18nextProvider i18n={ i18n }>
                                  <div style={ {textAlign: 'center', margin: 'auto'} }>
                                      <h6>{ i18n.t('start:StartingServices') }<DotProgress /></h6>
              Severity: Major
              Found in src/common/start.tsx and 1 other location - About 1 day to fix
              src/client/exit/index.tsx on lines 13..31

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

              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

                      return (
                          <div className='startingServiceWrap'>
                              <I18nextProvider i18n={ i18n }>
                                  <div style={ {textAlign: 'center', margin: 'auto'} }>
                                      <h6>{ i18n.t('start:servicesAreStopping') }<DotProgress /></h6>
              Severity: Major
              Found in src/client/exit/index.tsx and 1 other location - About 1 day to fix
              src/common/start.tsx on lines 120..138

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

              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

              File index.tsx has 522 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import * as React from 'react';
              import { connect } from 'react-redux';
              import { WithTranslation, withTranslation } from 'react-i18next';
              
              import { default as handlers, asyncProviders } from 'redux/actions';
              Severity: Major
              Found in src/client/lightweightMode/index.tsx - About 1 day to fix

                WS has 58 functions (exceeds 20 allowed). Consider refactoring.
                Open

                export class WS {
                
                    static handlers = {}; // uuid -> handler
                    static byUUID = {}; // uuid -> subscribeID
                    static subscribeRequests = {}; // subscribeId => descriptor
                Severity: Major
                Found in src/utils/ws.ts - About 1 day to fix

                  Function render has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                  Open

                      render(){
                  
                          const {step, t, prix, shape} = this.props;
                  
                          if(shape === 'advanced'){
                  Severity: Minor
                  Found in src/common/wizard/steps.tsx - About 7 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

                                                  <div className='form-group row'>
                                                      <label className='col-2 col-form-label'>{t('MinUploadMbits')}:</label>
                                                      <div className='col-6'>
                                                          <div className='input-group bootstrap-touchspin'>
                                                              <input type='text'
                  Severity: Major
                  Found in src/agent/offerings/createOffering/index.tsx and 1 other location - About 7 hrs to fix
                  src/agent/offerings/createOffering/index.tsx on lines 710..728

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

                  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

                                                  <div className='form-group row'>
                                                      <label className='col-2 col-form-label'>{t('MinDownloadMbits')}:</label>
                                                      <div className='col-6'>
                                                          <div className='input-group bootstrap-touchspin'>
                                                              <input type='text'
                  Severity: Major
                  Found in src/agent/offerings/createOffering/index.tsx and 1 other location - About 7 hrs to fix
                  src/agent/offerings/createOffering/index.tsx on lines 729..747

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

                  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

                              if(currentState === 'firstStart'){
                                  routes.push(
                                      <Route key='/' exact path='/' render={() => <SetLanguage mode={mode} role={role} />} />,
                                      <Route key='/setPassword' exact path='/setPassword' render={() => <SetPassword mode={mode} />} />,
                                      <Route key='/setAccount' path='/setAccount' render={() => <SetAccount isDefault={true} /> } />,
                  Severity: Major
                  Found in src/common/wizard/routes.tsx and 1 other location - About 7 hrs to fix
                  src/common/wizard/routes.tsx on lines 108..115

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

                  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

                              if(currentState === 'firstStart'){
                                  routes.push(
                                      <Route key='/' exact path='/' render={() => <SetLanguage mode={mode} role={role} />} />,
                                      <Route key='/setPassword' exact path='/setPassword' render={() => <SetPassword mode={mode} />} />,
                                      <Route key='/setAccount' path='/setAccount' render={() => <SetAccount isDefault={true} /> } />,
                  Severity: Major
                  Found in src/common/wizard/routes.tsx and 1 other location - About 7 hrs to fix
                  src/common/wizard/routes.tsx on lines 60..67

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

                  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

                  File ws.ts has 444 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import * as React from 'react';
                  import { connect } from 'react-redux';
                  import uuidv4 from 'uuid/v4';
                  
                  import * as api from './api';
                  Severity: Minor
                  Found in src/utils/ws.ts - About 6 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language