Showing 88 of 341 total issues
File picmg.py
has 653 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
File ipmitool.py
has 599 lines of code (exceeds 250 allowed). Consider refactoring. Open
#!/usr/bin/env python3
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
File hpm.py
has 541 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
File rmcp.py
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2018 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
File sdr.py
has 489 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
File vita.py
has 483 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2021 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
File device_messaging.py
has 426 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
Function usage
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def usage(toplevel=False):
commands = []
maxlen = 0
if toplevel:
- Read upRead up
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 main
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def main():
try:
opts, args = getopt.getopt(sys.argv[1:], 't:hvVI:H:U:P:L:o:b:p:r:J')
except getopt.GetoptError as err:
print(str(err))
- Read upRead up
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
File picmg.py
has 404 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
File constants.py
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
File fru.py
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
Hpm
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class Hpm(object):
@staticmethod
def _get_component_count(components):
"""Return the number of components."""
Function cmd_fru_print
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def cmd_fru_print(ipmi, args):
fru_id = 0
print_all = False
if len(args) > 0:
fru_id = int(args[0])
- Read upRead up
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 _send_and_receive
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def _send_and_receive(self, target, lun, netfn, cmdid, payload):
"""Send and receive data using RMCP interface.
target:
lun:
- Read upRead up
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
Picmg
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Picmg(object):
def get_picmg_properties(self):
return self.send_message_with_name('GetPicmgProperties')
def fru_control(self, fru_id, option):
Function parse_interface_options
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def parse_interface_options(interface_name, options):
if options:
options = options.split(',')
interface_options = {}
- Read upRead up
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
File message.py
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Copyright (c) 2014 Kontron Europe GmbH
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
File emulation.py
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
import argparse
import logging
import os
import random
import socket
Function _from_data
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _from_data(self, data):
buffer = ByteBuffer(data[5:])
# record key bytes
self._common_record_key(buffer.pop_slice(3))
# record body bytes