Skip to content

Conversation

@keithbored3310
Copy link

No description provided.

}
}
//Send the result back to the main function
return SumOfManhattanDistance;

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Trailing spaces not allowed.

Suggested change
return SumOfManhattanDistance;
return SumOfManhattanDistance;


for (let i = 0; i < x.length; i++){
for (let j = 0; j < x[i].length ; j++){
//Compute the result of the Manhattan Distance

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected exception block, space or tab after '//' in comment.

Suggested change
//Compute the result of the Manhattan Distance
// Compute the result of the Manhattan Distance


for (let i = 0; i < x.length; i++){
for (let j = 0; j < x[i].length ; j++){
//Compute the result of the Manhattan Distance

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected indentation of 6 spaces but found 1 tab.

Suggested change
//Compute the result of the Manhattan Distance
//Compute the result of the Manhattan Distance

for (let j = 0; j < x[i].length ; j++){
//Compute the result of the Manhattan Distance
SumOfManhattanDistance += (Math.abs(x[i] - x[j]) + Math.abs(y[i] - y[j]));
}

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected indentation of 4 spaces but found 1 tab.

Suggested change
}
}

*/
export default function manhattanDistance(x, y) {

let SumOfManhattanDistance = 0;

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected indentation of 2 spaces but found 0.

Suggested change
let SumOfManhattanDistance = 0;
let SumOfManhattanDistance = 0;

describe('manhattanDistance', () => {
it('should calculate the manhattan distance', () => {
expect(manhattanDistance(1,5,1,8)).toEqual(1);
})

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected indentation of 2 spaces but found 4.

Suggested change
})
})

SumOfManhattanDistance += (Math.abs(x[i] - x[j]) + Math.abs(y[i] - y[j]));
}
}
//Send the result back to the main function

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected exception block, space or tab after '//' in comment.

Suggested change
//Send the result back to the main function
// Send the result back to the main function

@@ -0,0 +1,19 @@
//This function is calculate the manhattan distance
/**

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Trailing spaces not allowed.

Suggested change
/**
/**


let SumOfManhattanDistance = 0;

for (let i = 0; i < x.length; i++){

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected indentation of 2 spaces but found 0.

Suggested change
for (let i = 0; i < x.length; i++){
for (let i = 0; i < x.length; i++){


describe('manhattanDistance', () => {
it('should calculate the manhattan distance', () => {
expect(manhattanDistance(1,5,1,8)).toEqual(1);

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: A space is required after ','.

Suggested change
expect(manhattanDistance(1,5,1,8)).toEqual(1);
expect(manhattanDistance(1, 5,1,8)).toEqual(1);

let SumOfManhattanDistance = 0;

for (let i = 0; i < x.length; i++){
for (let j = 0; j < x[i].length ; j++){

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Unexpected whitespace before semicolon.

Suggested change
for (let j = 0; j < x[i].length ; j++){
for (let j = 0; j < x[i].length; j++){

SumOfManhattanDistance += (Math.abs(x[i] - x[j]) + Math.abs(y[i] - y[j]));
}
}
//Send the result back to the main function

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected indentation of 2 spaces but found 0.

Suggested change
//Send the result back to the main function
//Send the result back to the main function

for (let i = 0; i < x.length; i++){
for (let j = 0; j < x[i].length ; j++){
//Compute the result of the Manhattan Distance
SumOfManhattanDistance += (Math.abs(x[i] - x[j]) + Math.abs(y[i] - y[j]));

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected indentation of 6 spaces but found 1 tab.

Suggested change
SumOfManhattanDistance += (Math.abs(x[i] - x[j]) + Math.abs(y[i] - y[j]));
SumOfManhattanDistance += (Math.abs(x[i] - x[j]) + Math.abs(y[i] - y[j]));

@@ -0,0 +1,19 @@
//This function is calculate the manhattan distance

Choose a reason for hiding this comment

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

Codacy has a fix for the issue: Expected exception block, space or tab after '//' in comment.

Suggested change
//This function is calculate the manhattan distance
// This function is calculate the manhattan distance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant