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

Limit code repetition in license namespace section #184

Open
Ugtan opened this issue Jun 13, 2020 · 4 comments
Open

Limit code repetition in license namespace section #184

Ugtan opened this issue Jun 13, 2020 · 4 comments
Labels

Comments

@Ugtan
Copy link
Collaborator

Ugtan commented Jun 13, 2020

Since the license request and license namespace section of the SPDX online tools is quite similar in functionality. Both of these section provides the user the ability to submit license requests or license namespace, But to a different repository. Some of the code of namespaces is quite similar to that of license request, We could have easily adapted our code to use license request code to limit code repetition.

Code repetition means we will have to test that code as well, make changes at both the places, similar js files take up space, and load time it slows down the website due to more HTTP requests.

Some egs of code repetition-

  1. Like these two functions
    def pull_request(request):

    def namespace_pull_request(request):
  2. Similarly, the files script.js and ns_script.js are quite similar.
@tomokos2
Copy link

Hi, may I work on this issue?

@rtgdk
Copy link
Collaborator

rtgdk commented Jun 16, 2020

@tomokos2 Yes, you can. You don't need to be an assignee to work on the issue.

@tomokos2
Copy link

tomokos2 commented Jun 24, 2020

@rtgdk Hi, I was thinking about how to solve the similarity issue in script.js and ns_script.js --

  1. Have 3 files, one holding the similar code and the other two holding the different code, and load two scripts each in editor.html and ns_editor.html.
  2. Combine the two files into one and have if statements that control which functions to use for the normal script and the namespace script?
    May I have your thoughts on these solutions? Is there one that would be preferable?
    Thank you.

@rtgdk
Copy link
Collaborator

rtgdk commented Jun 30, 2020

@tomokos2 The 1st option looks fine to me. Having a common template that contains common functions and elements will be the way to go.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants