firehol/netdata

View on GitHub

Showing 1,088 of 2,665 total issues

Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None,
Severity: Minor
Found in src/collectors/python.d.plugin/python_modules/pyyaml3/events.py - About 45 mins to fix

    Function __eq__ has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def __eq__(self, other):
            if isinstance(other, OrderedDict):
                if len(self) != len(other):
                    return False
                for p, q in zip(self.items(), other.items()):
    Severity: Minor
    Found in src/collectors/python.d.plugin/python_modules/third_party/ordereddict.py - About 45 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 sparkline has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        sparkline: function (prefix, chart, dimension, units, suffix) {
            if (options.data === null || typeof options.data.charts === 'undefined') {
                return '';
            }
    
    
    Severity: Minor
    Found in src/web/gui/main.js - About 45 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 genHash has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        genHash: function (forReload) {
            var hash = urlOptions.hash;
    
            if (urlOptions.pan_and_zoom === true) {
                hash += ';after=' + urlOptions.after.toString() +
    Severity: Minor
    Found in src/web/gui/main.js - About 45 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 deeply nested control flow statements.
    Open

                                if (tagName[0] === '/') {
    
                                    if (tagName !== ('/' + openTags[0])) {
                                        config.errMsg = 'ERROR en HTML: the top of the stack should be the tag that closes';
                                    } else {
    Severity: Major
    Found in src/web/gui/main.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if (countChars <= config.showChars) {
                                      bag += content.charAt(i); // Fix to ie 7 not allowing you to reference string characters using the []
                                      countChars++;
                                  } else {
                                      // Now I have the characters needed
      Severity: Major
      Found in src/web/gui/main.js - About 45 mins to fix

        Function generateHeadCharts has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function generateHeadCharts(type, chart, duration) {
            if (urlOptions.mode === 'print') {
                return '';
            }
        
        
        Severity: Minor
        Found in src/web/gui/main.js - About 45 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 deeply nested control flow statements.
        Open

                            if (copyIsArray) {
                                copyIsArray = false;
                                clone = src && jQuery.isArray(src) ? src : [];
                            } else {
                                clone = src && jQuery.isPlainObject(src) ? src : {};
        Severity: Major
        Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          } else if (copy !== undefined) {
                              target[name] = copy;
                          }
          Severity: Major
          Found in src/web/gui/v1/lib/d3pie-0.2.1-netdata-3.js - About 45 mins to fix

            Function expect_first_flow_mapping_key has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def expect_first_flow_mapping_key(self):
                    if isinstance(self.event, MappingEndEvent):
                        self.indent = self.indents.pop()
                        self.flow_level -= 1
                        self.write_indicator('}', False)
            Severity: Minor
            Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 45 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 deeply nested control flow statements.
            Open

                                    if self.encoding:
                                        data = data.encode(self.encoding)
                                    self.stream.write(data)
            Severity: Major
            Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                      if br == '\n':
                                          self.write_line_break()
                                      else:
                                          self.write_line_break(br)
                                  if ch is not None:
              Severity: Major
              Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if br == '\n':
                                            self.write_line_break()
                                        else:
                                            self.write_line_break(br)
                                    if ch is not None:
                Severity: Major
                Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 45 mins to fix

                  Function get_snippet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def get_snippet(self, indent=4, max_length=75):
                          if self.buffer is None:
                              return None
                          head = ''
                          start = self.pointer
                  Severity: Minor
                  Found in src/collectors/python.d.plugin/python_modules/pyyaml3/error.py - About 45 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 deeply nested control flow statements.
                  Open

                                          if br == '\n':
                                              self.write_line_break()
                                          else:
                                              self.write_line_break(br)
                                      self.write_indent()
                  Severity: Major
                  Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if not isinstance(subnode, MappingNode):
                                                raise ConstructorError("while constructing a mapping",
                                                        node.start_mark,
                                                        "expected a mapping for merging, but found %s"
                                                        % subnode.id, subnode.start_mark)
                    Severity: Major
                    Found in src/collectors/python.d.plugin/python_modules/pyyaml3/constructor.py - About 45 mins to fix

                      Function __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def __init__(self, name, index, line, column, buffer, pointer):
                      Severity: Minor
                      Found in src/collectors/python.d.plugin/python_modules/pyyaml3/error.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                if self.encoding:
                                                    data = data.encode(self.encoding)
                                                self.stream.write(data)
                        Severity: Major
                        Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if self.encoding:
                                                      data = data.encode(self.encoding)
                                                  self.stream.write(data)
                          Severity: Major
                          Found in src/collectors/python.d.plugin/python_modules/pyyaml3/emitter.py - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if self.peek(k) not in '0123456789ABCDEFabcdef':
                                                        raise ScannerError("while scanning a double-quoted scalar", start_mark,
                                                                "expected escape sequence of %d hexdecimal numbers, but found %r" %
                                                                    (length, self.peek(k)), self.get_mark())
                                                code = int(self.prefix(length), 16)
                            Severity: Major
                            Found in src/collectors/python.d.plugin/python_modules/pyyaml3/scanner.py - About 45 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language