Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Improve code quality in History (complexity) #182

Merged
merged 5 commits into from
Mar 4, 2015

Conversation

Lesterpig
Copy link
Contributor

// Rename deperecated apps
if ( app === "ZeroBin" ) {
app = "Message";
}
Copy link
Member

Choose a reason for hiding this comment

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

This if block still needs to exist in the refactored version.

Copy link
Member

Choose a reason for hiding this comment

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

We can remove this in a few weeks, but we need it at the moment -- I just need to find time to write and test a migration server side.

@smcgregor
Copy link
Member

I have not tested this locally yet so issues may yet arise, but other than the comments above I think this looks good.

@Lesterpig
Copy link
Contributor Author

Thanks! I'll fix issues from your comments :)

@irdan
Copy link
Member

irdan commented Mar 3, 2015

I have a feeling that the complexity of this code has not decreased significantly. I would sign up for CodeClimate and point to your branch to see how much the complexity was reduced.

@Lesterpig
Copy link
Contributor Author

@irdan Just C -> B in that case. It's mainly a test to setup correctly my environment.

@smcgregor
Copy link
Member

Code quality heuristics don't like having big blocks of code inside loops, which we often unintentionally ignored. Regardless, this should be easier to test.

Speaking of which, have you gotten to setting up Karma yet? How do the tests look on this?

@Lesterpig
Copy link
Contributor Author

@smcgregor I haven't found any test case for this callback function. Indeed, all tests are successful according to Karma.

EDIT: will write some tests tomorrow

@smcgregor
Copy link
Member

For reference, here is the current build running from my fork: https://travis-ci.org/smcgregor/privly-applications/builds/52995589

@Lesterpig
Copy link
Contributor Author

#157

expect(buttons[1].getAttribute("data-canonical-href")).toMatch(/show.html\?privlyOriginalURL\=testUrl/);

for(var i = 1; i <= 3; i++)
expect(cells[i].textContent).not.toBe(""); // TODO unit tests for parseDate
Copy link
Member

Choose a reason for hiding this comment

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

For better or for worse, I believe CodeClimate will complain about not bracketing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

@smcgregor
Copy link
Member

New unit test looks good. With one more for exclusively getMessageDOM, I think you are ready to go.

@smcgregor
Copy link
Member

Two tiny comments left.

Also, make sure you comment when you push new commits, otherwise people don't get emailed about it.


});
});
});
Copy link
Member

Choose a reason for hiding this comment

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

nit: newline

Copy link
Member

Choose a reason for hiding this comment

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

So many PRs to get through, didn't mean to repeat this.

@Lesterpig
Copy link
Contributor Author

No problem! :)

@smcgregor
Copy link
Member

I tested locally and all is good. I am just waiting for the tests to run on Continuous Integration, then I'll merge.

Note: You are likely going to have issues with your fork since you are developing on master. I recommend working on a feature branch.

@smcgregor smcgregor merged commit 35dc4e4 into privly:master Mar 4, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants