malparty / keywords Goto Github PK
View Code? Open in Web Editor NEWCodding challenge
Codding challenge
GoogleParser
does the following:
ParserService
depends on.That goes quite a bit against the Single Responsibility principle in OOP
main
branchdev.sh
.There should be no JS errors in the browser console.
The following errors appear in the browser console:
This is the output from the local terminal:
main
branchdev.sh
.All dependencies should be defined in /keywords/KeywordsApp/ClientApp/package.json
to ensure reproducibility of the development and production environments.
popper.js
is missing from the definition of the dependencies:
There are also some missing attribute in package.json
which should be referenced.
The project leverage the usage of classes in JS (so not prototype-based approach). However, the classes do seem more like a wrapper of methods instead of an actual object with attributes, public and static attributes.
This would allow changing the class invocation from:
$(function () {
new UploadForm().initForm();
});
to:
$(function () {
new UploadForm();
});
So the end result would be:
$(function () {
const $form = $('.csv-form');
new UploadForm($form);
});
This would abide by the composition principle in OOP.
initForm
(and other initialization methods) are fairly long and procedural.There are also some repetitions:
This could be resolved by extracting to "private" methods and/or separate objects.
this.form.change(() => {})
adds an event handler for the change
event. However the submit event is not leveraged and a method is called directly with this.submitForm();
. Instead the same approach should be used this.form.submit(() => {})
as it can be called with this.form.submit()
.
Note that using .on('event_type', fn())
is usually preferred for the reasons well summarize on this StackOverflow post.
Since a user needs to be authenticated to perform any action, there are checks in each controller method:
The issues:
main
branchdev.sh
.Some UI elements meant to be hidden are actually displayed.
This is the actual UI displayed:
I highlighted the areas which are intended to be hidden.
This gets weirder when uploading files
This issue could be caused by #26
While it's somewhat related to #32, the implementation of async operations can make it hard to reason about the whole parsing logic. There is a complexity level that needs to be addressed.
First, in ParserService
, the first level of complexity comes from understanding the purposes for the double Task.Delay
:
Then in GoogleParser
, there is the usage of await
in a foreach
loop:
In the end, only one keyword is processed at any given time. Therefore, the level of complexity could be reduced by having ParserService
schedule/trigger googleParser.ParseAsync()
for only one keyword.
What are your thoughts?
I had problems identifying which is the file naming convention on the migrations. Also, while checking the file content the class names also don't follow a consistent pattern all over. e.g. sometimes it's camelcase, sometimes all lowercase. I'm not a .Net expert, but afaik all classes should be Pascal case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
馃枛 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 馃搳馃搱馃帀
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google 鉂わ笍 Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.