Function weighted_multigraph
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def weighted_multigraph(graph_nodes, graph_edges, clean_data, output_dir, ignore_lat = False):
"""
Calls other functions to generate graphs that show the interaction between authors either through multiple edges or
through edge weights.
- 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 add_to_weighted_graph
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def add_to_weighted_graph(graph_obj, discussion_graph, json_data, nbunch, node_enum=list()):
"""
Add weighted edges to the DiGraph object recursively.
:param graph_obj: Object for a directed graph with mulitple edges.
- 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 add_to_multigraph
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def add_to_multigraph(graph_obj, discussion_graph, json_data, nbunch, label_prefix=''):
"""
Add multiple edges to the MultiDiGraph object recursively.
:param graph_obj: Object for a directed graph with mulitple edges.
- 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
Avoid deeply nested control flow statements. Open
if edge[0] in msgs_before_time and edge[1] in msgs_before_time:
discussion_graph.add_edge(*edge)
edge_file.close()
Function add_to_weighted_graph
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_to_weighted_graph(graph_obj, discussion_graph, json_data, nbunch, node_enum=list()):
Function weighted_multigraph
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def weighted_multigraph(graph_nodes, graph_edges, clean_data, output_dir, ignore_lat = False):
Function add_to_multigraph
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add_to_multigraph(graph_obj, discussion_graph, json_data, nbunch, label_prefix=''):