grommet/grommet-ferret

View on GitHub

Showing 151 of 386 total issues

Function _buildLocationSearch has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function _buildLocationSearch (query, filter, sort) {
  let result = '';
  if (query && query.toString().length > 0) {
    result += (result.length === 0 ? '?' : '&');
    result += `q=${encodeURIComponent(query.toString())}`;
Severity: Minor
Found in src/js/actions/indexHistory.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 TextTerm has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function TextTerm (text) {
  this._not = false;
  this._text = text;

  // if the string is quoted, require matching at both ends
Severity: Minor
Found in server/filter.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 AttributeTerm has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function AttributeTerm (text) {
  this._not = false;

  const parts = text.toLowerCase().split(':');
  this._name = parts[0];
Severity: Minor
Found in server/filter.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 componentWillReceiveProps has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  componentWillReceiveProps (nextProps) {
    // if any uploads have finished, refresh to pick up notifications
    for (let i=0; i<nextProps.uploads.length; i++) {
      let upload = nextProps.uploads[i];
      if ('Uploaded' === upload.state) {
Severity: Minor
Found in src/js/components/image/ImageIndex.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 watchTask has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export function watchTask (uri, progressHandler) {
  const promise = new Promise((resolve, reject) => {
    const check = () => {
      getItem(uri)
      .then(task => {
Severity: Minor
Found in src/js/actions/task.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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const { item, index, onlyActiveStatus, includeResource } = this.props;

    let separator;
    if (0 === index) {
Severity: Minor
Found in src/js/components/activity/ActivityListItem.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 layout has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

  layout () {
    const { container } = this.state;
    if (container) {
      let rect = container.getBoundingClientRect();
      let children = container.childNodes;
Severity: Minor
Found in src/js/utils/GraphicSizer.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 buildParams has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildParams (config, query, filter, sort) {
  let result = {
    category: config.category,
    count: pageSize,
    start: 0
Severity: Minor
Found in src/js/actions/index.js - About 1 hr to fix

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

      _onSubmit (event) {
        event.preventDefault();
        const { router } = this.context;
        const { count, template } = this.state;
        let errors = {};
    Severity: Minor
    Found in src/js/components/virtualMachine/VirtualMachineAdd.js - About 1 hr to fix

      Function addUtilization has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function addUtilization (item) {
        // If the item came from the generator, copy attributes so each item has
        // its own
        let attributes = item.attributes || {};
        if (item._indexAttributes) {
      Severity: Minor
      Found in server/generator.js - About 1 hr to fix

        Function respondToRequest has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function respondToRequest (connection, request) {
          let response = {op: 'update', id: request.id};
        
          try {
            if ('/rest/index/resources' === request.uri) {
        Severity: Minor
        Found in server/rest.js - About 1 hr to fix

          Function buildItems has 31 lines of code (exceeds 25 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

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

              _renderForm () {
                const { phase } = this.props;
            
                let summary;
                let contents;
            Severity: Minor
            Found in src/js/components/settings/DirectoryEdit.js - About 1 hr to fix

              Function _renderSections has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                _renderSections (sortProperty, sortDirection) {
                  const { index } = this.props;
                  const result = index.result || { items: [] };
                  const items = (result.items || []).slice(0);
                  let sections = [];
              Severity: Minor
              Found in src/js/components/virtualMachine/VirtualMachineIndex.js - About 1 hr to fix

                Function buildItem has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function buildItem (options) { //categoryName, index, name, date) {
                  const category = options.category;
                
                  const resource = {
                    name: options.name,
                Severity: Minor
                Found in server/generator.js - About 1 hr to fix

                  Function series has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      const series = items.map((item, index) => {
                        const areaValue = item[areaAttribute] ||
                          item.attributes[areaAttribute] || 0;
                        const colorValue = item[colorAttribute] ||
                          item.attributes[colorAttribute] || 0;
                  Severity: Minor
                  Found in src/js/components/Utilization.js - About 1 hr to fix

                    Function _renderNetworkFields has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      _renderNetworkFields () {
                        const { virtualMachine } = this.state;
                        const networks = (virtualMachine.networks || []).map((network, index) => {
                          return (
                            <ListItem key={index} justify="between" pad="none"
                    Severity: Minor
                    Found in src/js/components/virtualMachine/VirtualMachineEdit.js - About 1 hr to fix

                      Function _renderNetworkFields has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        _renderNetworkFields () {
                          const { template } = this.state;
                          const networks = template.networks.map((network, index) => {
                            return (
                              <ListItem key={index} justify="between" pad="none"
                      Severity: Minor
                      Found in src/js/components/virtualMachine/VirtualMachineAdd.js - About 1 hr to fix

                        Function _stateFromProps has a Cognitive Complexity of 10 (exceeds 5 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

                        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 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          _onSubmit (event) {
                            event.preventDefault();
                            const { router } = this.context;
                            const { count, template } = this.state;
                            let errors = {};
                        Severity: Minor
                        Found in src/js/components/virtualMachine/VirtualMachineAdd.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