invicnaper/MWF

View on GitHub

Showing 17 of 51 total issues

File flot-demo.js has 1190 lines of code (exceeds 250 allowed). Consider refactoring.
Open

//Flot Line Chart
$(document).ready(function() {
    console.log("document ready");
    var offset = 0;
    plot();
Severity: Major
Found in Template/js/demo/flot-demo.js - About 3 days to fix

    Function from_fcgi_response has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    def from_fcgi_response(text,flags = 0):
        result = ''
        state = 0
        if flags & TEST_GET_VALUES:
            pairs = make_pairs([('FCGI_MPXS_CONNS','0'),('FCGI_MAX_CONNS','5'),('FCGI_MAX_REQS','5')])
    Severity: Minor
    Found in Utils/t/tofcgi.py - About 4 hrs 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 test_io has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

    def test_io(name,method,input_f,output_f,seed=12,load=load_file,parse=identity):
        result=''
        try:
            input=load(input_f)
            output=load_file(output_f)
    Severity: Minor
    Found in Utils/t/proto_test.py - About 3 hrs 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 general_tests has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def general_tests(method):
        print "------------------- General Tests --------------------"
        session = Session()
        session.transmit('/new')
        cookie = session.received['sc']
    Severity: Major
    Found in Utils/t/session_interface_test.py - About 2 hrs to fix

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

          def update_state(self):
              if self.print_cookies:
                  print "Got following cookies"
              for name,cookie in self.received.items():
                  if self.print_cookies:
      Severity: Minor
      Found in Utils/t/httpclient.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 plot has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function plot() {
              var sin = [],
                  cos = [];
              for (var i = 0; i < 12; i += 0.2) {
                  sin.push([i, Math.sin(i + offset)]);
      Severity: Minor
      Found in Template/js/demo/flot-demo.js - About 1 hr to fix

        Function doPlot has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function doPlot(position) {
                $.plot($("#flot-line-chart-multi"), [{
                    data: oilprices,
                    label: "Oil price ($)"
                }, {
        Severity: Minor
        Found in Template/js/demo/flot-demo.js - About 1 hr to fix

          Function transfer_all has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

          def transfer_all(s,inp):
              s.setblocking(1)
              s.sendall(inp)
              s.setblocking(0)
              result = ''
          Severity: Minor
          Found in Utils/t/proto_test.py - About 55 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 test_io has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def test_io(name,method,input_f,output_f,seed=12,load=load_file,parse=identity):
          Severity: Major
          Found in Utils/t/proto_test.py - About 50 mins to fix

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

            def to_fcgi_request(text,flags = 0):
                request = '';
                if flags & TEST_GET_VALUES:
                    request+=fcgi_record(GET_VALUES,make_pairs([('FCGI_MPXS_CONNS',''),('FCGI_MAX_CONNS',''),('FCGI_MAX_REQS','')]),0)
                if flags & TEST_KEEP_ALIVE:
            Severity: Minor
            Found in Utils/t/tofcgi.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 test_request has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def test_request(url,status,content='ignore',valid=[],notvalid=[]):
            Severity: Minor
            Found in Utils/t/file_server_test.py - About 35 mins to fix

              Function test_valid has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def test_valid(name,url,params,ans,status):
              Severity: Minor
              Found in Utils/t/forwarder_test.py - About 35 mins to fix

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

                def test_unfinished_read(msg,reads,ignore):
                    print "Tesing %s with %d reads" % (msg,reads)
                    s=make_sock();
                    read_size = s.getsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF)
                    print "SO_RCVBUF=%d" % read_size
                Severity: Minor
                Found in Utils/t/http_timeouts_test.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 test_request has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def test_request(url,status,content='ignore',valid=[],notvalid=[]):
                    print "-- Testing %s" % url
                    s=make_sock();
                    s.send('GET %s HTTP/1.0\r\n\r\n' % url);
                    text = ''
                Severity: Minor
                Found in Utils/t/file_server_test.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

                Method requested_file has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def requested_file(request_line)
                  request_uri  = request_line.split(" ")[1]
                  path         = URI.unescape(URI(request_uri).path)
                
                  clean = []
                Severity: Minor
                Found in Tools/mwf_server/mwf_server.rb - 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 general_tests has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def general_tests(method):
                    print "------------------- General Tests --------------------"
                    session = Session()
                    session.transmit('/new')
                    cookie = session.received['sc']
                Severity: Minor
                Found in Utils/t/session_interface_test.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

                Function test_io has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def test_io(input,socket_type,target):
                    try:
                        s=socket.socket(socket_type,socket.SOCK_STREAM);
                        try:
                            s.connect(target)
                Severity: Minor
                Found in Utils/t/disco_test.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