Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad code #11

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ async function getPRDetails(): Promise<PRDetails> {
};
}

function terribleCode() {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function terribleCode is poorly named and does not convey its purpose. Consider renaming it to something more descriptive.

for (let i=0; i<10; i++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nested loops create a time complexity of O(n^5), which is highly inefficient. This should be refactored to avoid deep nesting.

console.log("i loop");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using console.log in a loop can lead to performance issues and cluttered output. Consider removing these logs or using a more efficient logging strategy.

for (let j=0; j<10; j++) {
console.log("j loop");
for (let k=0; k<10; k++) {
console.log("k loop");
for (let l=0; l<10; l++) {
console.log("l loop");
for (let m=0; m<10; m++) {
console.log('m loop');
}
}
}
}
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function terribleCode is defined but never called. If it is not needed, it should be removed to clean up the code.


async function getDiff(
owner: string,
repo: string,
Expand Down
Loading