4admin2root/my_tcpconn

View on GitHub

Showing 6 of 13 total issues

Function netJsonGraph has 336 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    d3.netJsonGraph = function(url, opts) {
        /**
         * Default options
         *
         * @param  {string}     el                  "body"      The container element                                  el: "body" [description]
Severity: Major
Found in static/netjsongraph.js - About 1 day to fix

    File netjsongraph.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // version 0.1
    (function () {
        /**
         * vanilla JS implementation of jQuery.extend()
         */
    Severity: Minor
    Found in static/netjsongraph.js - About 5 hrs to fix

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

      def getlist():
          """ get tcp4 network links """
          tcs = psutil.net_connections('tcp4')
          logging.debug('Get tcp4 connections :' + str(tcs))
          for i in tcs:
      Severity: Minor
      Found in client.py - 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 getbar2 has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      def getbar2():
          tca = TcpConnListAPI()
          tc = tca.getval()
          tcl = tc['tcp_conn_list']
          tcv = tc['tcp_conn_value']
      Severity: Minor
      Found in server.py - 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 getjson has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      def getjson():
          tcl = TcpConnListAPI().get()['tcp_conn_list']
          d_netjson = {'type': 'test', 'label': 'test', 'protocol': 'tcp', 'version': '0.0.1', 'metric': 'test', 'nodes': [], 'links': [] }
          nodes = []  # netjsongraph node list
          links = []  # netjsongraph link list
      Severity: Minor
      Found in server.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 getmatrix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def getmatrix():
          tca = TcpConnListAPI()
          tc = tca.getval()
          tcl = tc['tcp_conn_list']
          tcv = tc['tcp_conn_value']
      Severity: Minor
      Found in server.py - About 25 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

      Severity
      Category
      Status
      Source
      Language