Privatix/dapp-gui

View on GitHub

Showing 96 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

            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

              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

                  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

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

                        render(){
                    
                            const { t, offering, localSettings, accounts, serviceName } = this.props;
                            const { account, customDeposit, thereAreActiveChannels, gasPrice } = this.state;
                    
                    
                    Severity: Major
                    Found in src/client/vpn_list/acceptOffering.tsx - About 6 hrs to fix

                      Function createStorage has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const createStorage = () => {
                          const storage = createStore(reducers, applyMiddleware(
                              thunk as ThunkMiddleware<State, AnyAction> // lets us dispatch() functions
                            ));
                      
                      
                      Severity: Minor
                      Found in src/utils/storage/index.ts - About 5 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

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

                      import * as React from 'react';
                      import i18n from 'i18next/init';
                      
                      import CopyToClipboard from 'common/copyToClipboard';
                      
                      
                      Severity: Minor
                      Found in src/common/tables/index.tsx - About 5 hrs to fix

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

                        import * as React from 'react';
                        import { WithTranslation, withTranslation } from 'react-i18next';
                        import { connect } from 'react-redux';
                        import Pagination from 'react-js-pagination';
                        
                        
                        Severity: Minor
                        Found in src/client/vpn_list/list/index.tsx - About 5 hrs to fix

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

                              render(){
                          
                                  const { t, offering } = this.props;
                                  const offeringIpType = ipTypes.filter(ipType => ipType.type === offering.ipType);
                          
                          
                          Severity: Major
                          Found in src/agent/offerings/offeringView.tsx - About 5 hrs to fix

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

                                render() {
                            
                                    const { t, account, localSettings } = this.props;
                                    const { destination, address, gasPrice, transferStarted } = this.state;
                            
                            
                            Severity: Major
                            Found in src/common/accounts/accountView.tsx - About 4 hrs to fix

                              Function createStorage has 135 lines of code (exceeds 40 allowed). Consider refactoring.
                              Open

                              export const createStorage = () => {
                                  const storage = createStore(reducers, applyMiddleware(
                                      thunk as ThunkMiddleware<State, AnyAction> // lets us dispatch() functions
                                    ));
                              
                              
                              Severity: Major
                              Found in src/utils/storage/index.ts - About 4 hrs to fix

                                File connecting.tsx has 356 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import * as React from 'react';
                                import { connect } from 'react-redux';
                                import { withRouter } from 'react-router-dom';
                                import { withTranslation, Trans } from 'react-i18next';
                                import Countdown from 'react-countdown-now';
                                Severity: Minor
                                Found in src/client/dashboard/connecting.tsx - About 4 hrs to fix

                                  Function checkStatus has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      checkStatus(channel: ClientChannel){
                                          const model = this.model;
                                          this.model = channel;
                                  
                                          if(!model || model.job.jobtype !== channel.job.jobtype){
                                  Severity: Minor
                                  Found in src/models/channel.ts - About 4 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

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

                                      render() {
                                  
                                          const {t, isModal} = this.props;
                                          const {ethAddr, didIt, getPrix, done, err} = this.state;
                                          const advancedMode = !this.isSimpleMode();
                                  Severity: Major
                                  Found in src/common/wizard/getPrix.tsx - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language