firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

Function _disconnect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _disconnect(self):
        """
        Close socket connection
        :return:
        """

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 get_data_per_code_status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def get_data_per_code_status(self, raw_data):
        data = defaultdict(int)
        for code, value in raw_data['total_status_code_count'].items():
            code_prefix = code[0]
            if code_prefix == '1' or code_prefix == '2' or code == '304':
Severity: Minor
Found in src/collectors/python.d.plugin/traefik/traefik.chart.py - About 35 mins 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 load_collectors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def load_collectors():
    ret = []

    entries = get_collector_metadata_entries()

Severity: Minor
Found in integrations/gen_integrations.py - About 35 mins 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 load_agent_notifications has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def load_agent_notifications():
    ret = []

    for repo, path, match in AGENT_NOTIFICATION_SOURCES:
        if match and path.exists() and path.is_dir():
Severity: Minor
Found in integrations/gen_integrations.py - About 35 mins 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 load_exporters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def load_exporters():
    ret = []

    for repo, path, match in EXPORTER_SOURCES:
        if match and path.exists() and path.is_dir():
Severity: Minor
Found in integrations/gen_integrations.py - About 35 mins 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 load_authentications has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def load_authentications():
    ret = []

    for repo, path, match in AUTHENTICATION_SOURCES:
        if match and path.exists() and path.is_dir():
Severity: Minor
Found in integrations/gen_integrations.py - About 35 mins 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 load_cloud_notifications has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def load_cloud_notifications():
    ret = []

    for repo, path, match in CLOUD_NOTIFICATION_SOURCES:
        if match and path.exists() and path.is_dir():
Severity: Minor
Found in integrations/gen_integrations.py - About 35 mins 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 load_logs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def load_logs():
    ret = []

    for repo, path, match in LOGS_SOURCES:
        if match and path.exists() and path.is_dir():
Severity: Minor
Found in integrations/gen_integrations.py - About 35 mins 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 load_deploy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def load_deploy():
    ret = []

    for repo, path, match in DEPLOY_SOURCES:
        if match and path.exists() and path.is_dir():
Severity: Minor
Found in integrations/gen_integrations.py - About 35 mins 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

Avoid too many return statements within this function.
Open

            return JSON.parse(data);
Severity: Major
Found in src/web/gui/src/dashboard.js/utils.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return def;
    Severity: Major
    Found in src/web/gui/src/dashboard.js/utils.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                  return function (value) {
                      return value;
                  };
      Severity: Major
      Found in src/web/gui/src/dashboard.js/units-conversion.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return value !== 0;
        Severity: Major
        Found in src/web/gui/src/dashboard.js/utils.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                              return function (value) {
                                  return value / tdivider;
                              };
          Severity: Major
          Found in src/web/gui/src/dashboard.js/units-conversion.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                return function (value) {
                                    return value;
                                };
            Severity: Major
            Found in src/web/gui/src/dashboard.js/units-conversion.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                          return this.convertibleUnits[units][x].convert;
              Severity: Major
              Found in src/web/gui/src/dashboard.js/units-conversion.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return this.convertibleUnits[units][desired_units].convert;
                Severity: Major
                Found in src/web/gui/src/dashboard.js/units-conversion.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return function (value) {
                                          return value / tdivider;
                                      };
                  Severity: Major
                  Found in src/web/gui/src/dashboard.js/units-conversion.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    return function (value) {
                                        return value;
                                    };
                    Severity: Major
                    Found in src/web/gui/src/dashboard.js/units-conversion.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return def;
                      Severity: Major
                      Found in src/web/gui/src/dashboard.js/utils.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language