Showing 229 of 518 total issues
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
createdBy: Option[DbRef[User]],
projectId: DbRef[Project],
comment: String,
resolvedAt: Option[Instant],
resolvedBy: Option[DbRef[User]],
Avoid deeply nested control flow statements. Open
Open
if (commonlength !== 0) {
if ((pointer - count_delete - count_insert) > 0 &&
diffs[pointer - count_delete - count_insert - 1][0] ==
DIFF_EQUAL) {
diffs[pointer - count_delete - count_insert - 1][1] +=
Avoid deeply nested control flow statements. Open
Open
if user_input == "yes":
print("Deleted " + project_name)
cursor.execute("DELETE FROM projects WHERE id = " + project_id)
elif user_input == "no":
print("Setting the Recommended Version ID to -1")
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
expiration: Instant,
token: String,
versionId: DbRef[Version],
address: InetString,
isConfirmed: Boolean = false,
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
homepage: Option[String],
issues: Option[String],
sources: Option[String],
support: Option[String],
license: ProjectLicense,
Avoid deeply nested control flow statements. Open
Open
while True:
user_input = input("Delete " + project_name + "? [yes/no] ")
if user_input in ["yes", "no"]:
break
else:
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
userId: DbRef[User],
originId: Option[DbRef[User]] = None,
notificationType: NotificationType,
messageArgs: NEL[String],
action: Option[String] = None,
Avoid deeply nested control flow statements. Open
Open
if (diff_text == bigpatch.diffs[0][1]) {
bigpatch.diffs.shift();
} else {
bigpatch.diffs[0][1] =
bigpatch.diffs[0][1].substring(diff_text.length);
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
projectId: DbRef[Project],
parentId: Option[DbRef[Page]],
name: String,
slug: String,
isDeletable: Boolean,
Method watchingQuery
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
user: String,
canSeeHidden: Boolean,
currentUserId: Option[DbRef[User]],
order: ProjectSortingStrategy,
limit: Long,
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
apiKey: String,
adminUser: String,
apiUri: Uri,
breakerMaxFailures: Int,
breakerResetDur: FiniteDuration,
Constructor has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
id: Long,
username: String,
email: String,
avatarUrl: Option[String],
lang: Option[Locale],
Function onCustomSubmit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var onCustomSubmit = function(toggle, channelName, channelHex, title, submit, nonReviewed) {
Function diff_xIndex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
diff_match_patch.prototype.diff_xIndex = function(diffs, loc) {
var chars1 = 0;
var chars2 = 0;
var last_chars1 = 0;
var last_chars2 = 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
Method showUserAction
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
user: String,
sort: Option[ProjectSortingStrategy],
limit: Option[Long],
offset: Long,
query: (
Avoid deeply nested control flow statements. Open
Open
for (var y = 0; y < patches[x].diffs.length; y++) {
var mod = patches[x].diffs[y];
if (mod[0] !== DIFF_EQUAL) {
index2 = this.diff_xIndex(diffs, index1);
}
Avoid deeply nested control flow statements. Open
Open
if (x1 >= x2) {
// Overlap detected.
return this.diff_bisectSplit_(text1, text2, x1, y1, deadline);
}
Avoid deeply nested control flow statements. Open
Open
if (commonlength !== 0) {
diffs[pointer][1] = text_insert.substring(text_insert.length -
commonlength) + diffs[pointer][1];
text_insert = text_insert.substring(0, text_insert.length -
commonlength);
Avoid deeply nested control flow statements. Open
Open
if os.path.isfile(old_sig_path):
print("Old sig: " + old_sig_path + "\nNew sig: " + new_sig_path)
os.rename(old_sig_path, new_sig_path)
else:
Method apply
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
loginUrl: String,
signupUrl: String,
verifyUrl: String,
secret: String,
timeout: FiniteDuration,