asn10038 / lrn-deep Goto Github PK
View Code? Open in Web Editor NEWThis project forked from duanqn/lrn-deep
A Web application for building neural networks interactively.
This project forked from duanqn/lrn-deep
A Web application for building neural networks interactively.
users/views.py:13:4: R1705: Unnecessary "else" after "return" (no-else-return)
users/views.py:15:8: R1705: Unnecessary "else" after "return" (no-else-return)
{This is part of Bug Hunt 2 for Wei Luo (wl2671) and Zhuangyu Ren (zr2209) }
On line 6 of models.py, line 4 of apps.py, lines 5, 8, 12 and 14 of forms.py, line 9 of admin.py, line 9 of 0001_initial.py and apps.py in canvas, there are too few public methods. This basically says that classes aren't meant to just store data. Classes should have at least a few methods to operate on the data that they hold.
Name: Nathan Reitinger (nr2645); Brett Landau (bl2719)
Class: COMS 4156
Assignment: Bug Hunt 2
many of the variables used in the /canvas
folder are unused---though likely known, because this was just a shell for the second sprint 👍 . This analysis is from vulture
by the way https://pypi.org/project/vulture/
Here is the warnings for django setting. We are not familiar with django and just put here in case you can use it!:p
************* Module lrndeep.settings
W: 1,0: Missing required field 'MANAGERS'
W: 1,0: Missing required field 'ADMINS'
W: 1,0: Missing required field 'TEMPLATE_DEBUG'
W: 1,0: Missing required field 'MIDDLEWARE_CLASSES'
By Danyang He (dh2914) and Chi Zhang (cz2517)
I know this has other similar issues, but I found these in the users folder:
users/admin.py:2:0: W0611: Unused get_user_model imported from django.contrib.auth (unused-import)
users/models.py:1:0: W0611: Unused models imported from django.db (unused-import)
users/tests.py:1:0: W0611: Unused TestCase imported from django.test (unused-import)
users/urls.py:3:0: W0611: Unused login imported from django.contrib.auth (unused-import)
users/urls.py:3:0: W0611: Unused logout imported from django.contrib.auth (unused-import)
users/views.py:2:0: W0611: Unused reverse_lazy imported from django.urls (unused-import)
users/views.py:2:0: W0611: Unused reverse imported from django.urls (unused-import)
users/views.py:3:0: W0611: Unused generic imported from django.views (unused-import)
users/views.py:4:0: W0611: Unused HttpResponse imported from django.http (unused-import)
Name: Nathan Reitinger (nr2645); Brett Landau (bl2719)
Class: COMS 4156
Assignment: Bug Hunt 2
not a true bug, but readme says to cd lrn-deep
when the folder is named lrndeep
(This is part of Bug Hunt 2 for Wei Luo (wl2671) and Zhuangyu Ren (zr2209)
On line 19 of views.py, the line length is 109. The recommended maximum line length is 100. The simple solution is to break this into two lines. On lines 21, 23 to 33 of 0001_initial.py, the line lengths are much longer than 100. For example, line 25 is 329 characters long. The simple solution is break these into different lines.
This warning appears in the Pylint report when an imported module or variable is included, but not used any other time. The Pylint bug report which shows this warning is depicted below:
************* Module canvas.views
W: 4, 0: Unused reverse imported from django.urls (unused-import)
************* Module lrndeep.urls
W: 18, 0: Unused TemplateView imported from django.views.generic.base (unused-import)
************* Module users.models
W: 1, 0: Unused models imported from django.db (unused-import)
************* Module users.admin
W: 2, 0: Unused get_user_model imported from django.contrib.auth (unused-import)
************* Module users.tests
W: 1, 0: Unused TestCase imported from django.test (unused-import)
************* Module users.urls
W: 3, 0: Unused login imported from django.contrib.auth (unused-import)
W: 3, 0: Unused logout imported from django.contrib.auth (unused-import)
************* Module users.views
W: 2, 0: Unused reverse_lazy imported from django.urls (unused-import)
W: 2, 0: Unused reverse imported from django.urls (unused-import)
W: 3, 0: Unused generic imported from django.views (unused-import)
W: 4, 0: Unused HttpResponse imported from django.http (unused-import)
These warnings arise because multiple modules include variables/functions imported from django, though they are not used directly.
reference: https://stackoverflow.com/questions/11957106/unused-import-warning-and-pylint
The following is a Pylint snippet of where this warning was found:
************* Module canvas.views
R: 12, 4: Unnecessary "else" after "return" (no-else-return)
************* Module users.views
R: 15, 8: Unnecessary "else" after "return" (no-else-return)
R: 26, 4: Unnecessary "else" after "return" (no-else-return)
R: 30, 8: Unnecessary "else" after "return" (no-else-return)
This warning is raised by the refactoring checker of Pylint. It is raised when there are if statements preceding an else block that all have return statements inside of them. This is a problem due to it hurting the maintainability and readability in the code that could cause bugs to arise in the future (i.e. an addition if code block without a return statement). The else code block should be removed in order to keep the same functionality but improve the code.
References:
https://pylint.readthedocs.io/en/latest/technical_reference/features.html
Name: Nathan Reitinger (nr2645); Brett Landau (bl2719)
Class: COMS 4156
Assignment: Bug Hunt 2
missing semicolon on line 142 of canvas.js
} else {
id += 1;
//warehouse.model.addNodeData({key: input+", "+output, category: ""+output})
warehouse.model.addNodeData({key: id, input: ""+input, output: ""+output, disp: input+", "+output})
}
obj.findObject("SHAPE").innerHTML = txt;
}
... "+output})<== goes here
After downloading lrn-deep and installing requirements.txt, I had to set the DJANGO_SETTINGS_MODULE
to run the server. (export DJANGO_SETTINGS_MODULE=lrndeep.settings
). Perhaps include this step in your documentation?
A snippet of the Pylint bug report is as follows:
************* Module canvas.urls
E: 3, 0: No name 'path' in module 'django.urls' (no-name-in-module)
************* Module lrndeep.urls
E: 17, 0: No name 'include' in module 'django.urls' (no-name-in-module)
E: 17, 0: No name 'path' in module 'django.urls' (no-name-in-module)
************* Module users.urls
E: 1, 0: No name 'path' in module 'django.urls' (no-name-in-module)
This particular error identified by Pylint is part of its variable checker system. It is raised when Pylint can't find the particular variable that has been imported from another module. In this case, the code is still able to run without error due to the error being caused by the lack of an environmental variable being set for the specific Django module.
References:
https://stackoverflow.com/questions/2108505/pylint-failing-for-a-number-of-django-imports
In users.models, we found one warning for your reference
************* Module users.models
W: 10,4:CustomUser.str: Use unicode instead of str
By Danyang He(dh2914) and Chi Zhang(cz2517)
The Pylint report declares this design checker message when a class has 0 or few public methods, therefore the classes are used just to store data. Each class is supposed to have at least a few methods to manipulate the data that is being stored.
************* Module users.forms
R: 14, 4: Too few public methods (0/2) (too-few-public-methods)
Reference: https://stackoverflow.com/questions/14027417/what-does-pylints-too-few-public-methods-message-mean
{This is part of Bug Hunt 2 for Wei Luo (wl2671) and Zhuangyu Ren (zr2209) }
On line 12 of views.py in canvas and lines 15, 26, 30 of views.py in users, there is a warning “no else return”, which says that “Unnecessary else after return”. This happens because all return statements are parts of if-else control flows, meaning that there is no “default” return value. This could potentially lead to a bug if there were further additions to the code, since one might erroneously assume that there is a default return value.
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.