maestro-server/discovery-api

View on GitHub
share/doc/pycurl/examples/xmlrpc_curl.py

Summary

Maintainability
A
0 mins
Test Coverage

Whitespace before ']'
Open

    xmlrpc_h = [ "Content-Type: text/xml" ]

Avoid extraneous whitespace.

Avoid extraneous whitespace in these situations:
- Immediately inside parentheses, brackets or braces.
- Immediately before a comma, semicolon, or colon.

Okay: spam(ham[1], {eggs: 2})
E201: spam( ham[1], {eggs: 2})
E201: spam(ham[ 1], {eggs: 2})
E201: spam(ham[1], { eggs: 2})
E202: spam(ham[1], {eggs: 2} )
E202: spam(ham[1 ], {eggs: 2})
E202: spam(ham[1], {eggs: 2 })

E203: if x == 4: print x, y; x, y = y , x
E203: if x == 4: print x, y ; x, y = y, x
E203: if x == 4 : print x, y; x, y = y, x

Indentation is not a multiple of 4
Open

           self.c.perform()

Use indent_size (PEP8 says 4) spaces per indentation level.

For really old code that you don't want to mess up, you can continue
to use 8-space tabs.

Okay: a = 1
Okay: if a == 0:\n    a = 1
E111:   a = 1
E114:   # a = 1

Okay: for item in items:\n    pass
E112: for item in items:\npass
E115: for item in items:\n# Hi\n    pass

Okay: a = 1\nb = 2
E113: a = 1\n    b = 2
E116: a = 1\n    # b = 2

Whitespace after '['
Open

    xmlrpc_h = [ "Content-Type: text/xml" ]

Avoid extraneous whitespace.

Avoid extraneous whitespace in these situations:
- Immediately inside parentheses, brackets or braces.
- Immediately before a comma, semicolon, or colon.

Okay: spam(ham[1], {eggs: 2})
E201: spam( ham[1], {eggs: 2})
E201: spam(ham[ 1], {eggs: 2})
E201: spam(ham[1], { eggs: 2})
E202: spam(ham[1], {eggs: 2} )
E202: spam(ham[1 ], {eggs: 2})
E202: spam(ham[1], {eggs: 2 })

E203: if x == 4: print x, y; x, y = y , x
E203: if x == 4: print x, y ; x, y = y, x
E203: if x == 4 : print x, y; x, y = y, x

Comparison to none should be 'if cond is not none:'
Open

        if username != None and password != None:

Comparison to singletons should use "is" or "is not".

Comparisons to singletons like None should always be done
with "is" or "is not", never the equality operators.

Okay: if arg is not None:
E711: if arg != None:
E711: if None == arg:
E712: if arg == True:
E712: if False == arg:

Also, beware of writing if x when you really mean if x is not None
-- e.g. when testing whether a variable or argument that defaults to
None was set to some other value.  The other value might have a type
(such as a container) that could be false in a boolean context!

Too many leading '#' for block comment
Open

    ## Test

Separate inline comments by at least two spaces.

An inline comment is a comment on the same line as a statement.
Inline comments should be separated by at least two spaces from the
statement. They should start with a # and a single space.

Each line of a block comment starts with a # and a single space
(unless it is indented text inside the comment).

Okay: x = x + 1  # Increment x
Okay: x = x + 1    # Increment x
Okay: # Block comment
E261: x = x + 1 # Increment x
E262: x = x + 1  #Increment x
E262: x = x + 1  #  Increment x
E265: #Block comment
E266: ### Block comment

Comparison to none should be 'if cond is not none:'
Open

        if username != None and password != None:

Comparison to singletons should use "is" or "is not".

Comparisons to singletons like None should always be done
with "is" or "is not", never the equality operators.

Okay: if arg is not None:
E711: if arg != None:
E711: if None == arg:
E712: if arg == True:
E712: if False == arg:

Also, beware of writing if x when you really mean if x is not None
-- e.g. when testing whether a variable or argument that defaults to
None was set to some other value.  The other value might have a type
(such as a container) that could be false in a boolean context!

There are no issues that match your filters.

Category
Status