grommet/grommet-ferret

View on GitHub

Showing 151 of 386 total issues

Function render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render () {
    const { index } = this.props;

    const filter = index.filter || {};
    let sortProperty, sortDirection;
Severity: Major
Found in src/js/components/virtualMachine/VirtualMachineFilter.js - About 2 hrs to fix

    Function render has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render () {
        let { activity: {item, children}, role } = this.props;
    
        let timestamp = this._renderTimestamp(item);
        let owner = this._renderOwner(item);
    Severity: Major
    Found in src/js/components/activity/ActivityItem.js - About 2 hrs to fix

      Function _renderNodeFields has 51 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _renderNodeFields (node, index) {
          const { nodes } = this.state;
          const errors = this.state.errors.nodes[index] || {};
      
          let addressField;
      Severity: Major
      Found in src/js/components/settings/NodesEdit.js - About 2 hrs to fix

        Function _onSubmit has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _onSubmit () {
            let errors = { nodes: [] };
            let noErrors = true;
        
            this.state.nodes.forEach((node, index) => {
        Severity: Minor
        Found in src/js/components/settings/NodesEdit.js - About 2 hrs to fix

          Function render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render () {
              const { productName, role, software, onAction } = this.props;
          
              let menu, details;
          
          
          Severity: Minor
          Found in src/js/components/settings/SoftwareNotification.js - About 1 hr to fix

            Function NodesSection has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const NodesSection = (props) => {
            
              const { productName, role, settings, onOpen } = props;
              const nodes = settings.nodes || [];
              let contents;
            Severity: Minor
            Found in src/js/components/settings/NodesSection.js - About 1 hr to fix

              Function render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render () {
                  const { index, role } = this.props;
                  const { searchText } = this.state;
                  const result = index.result || {};
              
              
              Severity: Minor
              Found in src/js/components/size/SizeIndex.js - About 1 hr to fix

                Function getItems has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                export function getItems (categoryName, raw) {
                  let result = [];
                  if (categoryName) {
                    if (Array.isArray(categoryName)) {
                      for (var i = 0; i < categoryName.length; i++) {
                Severity: Minor
                Found in server/data.js - About 1 hr 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 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    const { item, includeResource } = this.props;
                
                    let icon;
                    if ('Active' === item.state || 'Locked' === item.state) {
                Severity: Minor
                Found in src/js/components/activity/ActivityTile.js - About 1 hr to fix

                  Function _stateFromProps has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    _stateFromProps (props, query) {
                      const { utilization: {result: {items}} } = props;
                      const areaAttribute =
                        (this.state && this.state.areaAttribute ? this.state.areaAttribute :
                          props.areaAttribute);
                  Severity: Minor
                  Found in src/js/components/Utilization.js - About 1 hr to fix

                    Function _renderForm has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      _renderForm () {
                        const { hypervisor, productName, settings } = this.props;
                        let errors = this.state.errors;
                        let submitLabel = 'Connect';
                    
                    
                    Severity: Minor
                    Found in src/js/components/settings/HypervisorEdit.js - About 1 hr to fix

                      Function initializeSettings has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function initializeSettings () {
                        const settings = {
                          description: 'These are the configuration settings for an Ingot.',
                          state: 'initial', // initial | updating | ready
                          name: 'cluster PA 4',
                      Severity: Minor
                      Found in server/generator.js - About 1 hr to fix

                        Function reduce has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function reduce(result) {
                          for (let name in result.categories) {
                            if (result.categories.hasOwnProperty(name)) {
                              let items = result.categories[name];
                              if (items.length > REDUCE_LIMIT) {
                        Severity: Minor
                        Found in server/map.js - About 1 hr to fix

                          Function HypervisorSection has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const HypervisorSection = (props) => {
                          
                            const { productName, role, settings, onOpen } = props;
                            const hypervisor = settings.hypervisor || {};
                            let contents;
                          Severity: Minor
                          Found in src/js/components/settings/HypervisorSection.js - About 1 hr to fix

                            Function search has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function search (params, success, error) {
                            
                              if (! client) {
                                client = ldap.createClient({
                                  url: 'ldap://' + params.address,
                            Severity: Minor
                            Found in server/ldap.js - About 1 hr to fix

                              Function render has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                render () {
                                  const { index } = this.props;
                                  const { filterActive, searchText, selection } = this.state;
                                  const result = index.result || {};
                              
                              
                              Severity: Minor
                              Found in src/js/components/activity/ActivityIndex.js - About 1 hr to fix

                                Function watchNotifications has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function watchNotifications (config, preserveUris, dispatch) {
                                  const context = config.context;
                                  let queryText, filter;
                                  if (context.uri || context.category || context.global) {
                                    if (context.uri) {
                                Severity: Minor
                                Found in src/js/actions/notifications.js - About 1 hr to fix

                                  Function render has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    render () {
                                      const { status } = this.props;
                                  
                                      let progress;
                                      if (status.progress) {
                                  Severity: Minor
                                  Found in src/js/components/Status.js - About 1 hr to fix

                                    Function buildItems has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    function buildItems (category) {
                                      let date = new Date();
                                      let count = category.count || RESOURCE_COUNT;
                                    
                                      for (var i = 1; i <= count; i++) {
                                    Severity: Minor
                                    Found in server/generator.js - About 1 hr 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 _onSubmit has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                      _onSubmit () {
                                        let hypervisor = {...this.props.hypervisor};
                                        if (hypervisor.address && ! hypervisor.certificate) {
                                          this.setState({ busy: 'Connecting' });
                                          this.props.dispatch(loadHypervisorCertificate(hypervisor));
                                    Severity: Minor
                                    Found in src/js/components/settings/HypervisorEdit.js - About 1 hr 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