Function keywords
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
def keywords(log_dict, nicks, nick_same_list):
"""
Returns keywods for all users
Args:
- Read upRead up
- Create a ticketCreate a ticket
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 nick_change_graph
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def nick_change_graph(log_dict, DAY_BY_DAY_ANALYSIS=False):
""" creates a graph which tracks the nick changes of the users
where each edge has a time stamp denoting the time
at which the nick was changed by the user
- Read upRead up
- Create a ticketCreate a ticket
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 user.py
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
import networkx as nx
import re
import sys
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction import text
- Create a ticketCreate a ticket
Function keywords_clusters
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def keywords_clusters(log_dict, nicks, nick_same_list, output_directory, out_file_name):
"""
Uses `keywords` to form clusters of words post TF IDF (optional).
Args:
- Read upRead up
- Create a ticketCreate a ticket
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 top_keywords_for_nick
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def top_keywords_for_nick(user_keyword_freq_dict, nick, threshold, min_words_spoken):
"""
outputs top keywords for a particular nick
Args:
- Read upRead up
- Create a ticketCreate a ticket
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
while earlier_line_no >= 0: #to find the line just before "=="" so as to find time of Nick Change
earlier_line_no = earlier_line_no - 1
if(day_log[earlier_line_no][0] != '='):
year, month, day = util.get_year_month_day(day_content)
today_nick_change_graph, aggregate_nick_change_graph = util.build_graphs(nick1, nick2, day_log[earlier_line_no][1:6], year, month, day, today_nick_change_graph, aggregate_nick_change_graph)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if fr:
user_words_dict.append({'sender':nick_sender, 'words':word_list_lemmatized })
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for ind in order_centroids[i, :config.SHOW_N_WORDS_PER_CLUSTER]:
outfile.write(' %s\n' % terms[ind])
outfile.write("\n")
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if correctedNickReciever in message:
message.remove(correctedNickReciever)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for dic in user_words_dict:
if dic['sender'] == nick_sender:
dic['words'].extend(word_list_lemmatized)
fr = 0
if fr:
- Create a ticketCreate a ticket
Function get_nick_receiver
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_nick_receiver(nick_receiver, rec, nick_to_compare, nick_name, nicks, nick_same_list):
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if(earlier_line_no == -1):
today_nick_change_graph.add_edge(nick1, nick2, weight=rem_time)
aggregate_nick_change_graph.add_edge(nick1, nick2, weight = rem_time)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for nick_name in nicks:
rec_list = [e.strip() for e in line.split(':')] #receiver list splited about :
rec_list = util.rec_list_splice(rec_list)
if not rec_list[1]: #index 0 will contain time 14:02
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
for word in word_list_temp:
word = word.lower()
word_list.append(word.replace("'",""))
word_list_lemmatized = []
- Create a ticketCreate a ticket
Function keywords_clusters
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def keywords_clusters(log_dict, nicks, nick_same_list, output_directory, out_file_name):
- Create a ticketCreate a ticket
Error: Missing parentheses in call to 'print'. Did you mean print(print "No word's normalised score crosses the value of", threshold)? (<unknown>, line 121)</unknown> Open
print "No word's normalised score crosses the value of", threshold
- Read upRead up
- Create a ticketCreate a ticket
- Exclude checks
We encountered an error attempting to analyze this line.