Code Monkey home page Code Monkey logo

lrn-deep's People

Contributors

cathymouse96 avatar duanqn avatar sg-lunch avatar wwenqi18 avatar

Watchers

 avatar  avatar

Forkers

pow25 bontiveros

lrn-deep's Issues

Unnecessary else after return

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)

too few public methods

{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.

unused variables (likely known)

coms 4156 bug hunt 2

Name: Nathan Reitinger (nr2645); Brett Landau (bl2719)
Class: COMS 4156 
Assignment: Bug Hunt 2

issue

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/

file

screen shot 2018-11-19 at 10 03 04 pm

convention (style)

coms 4156 bug hunt 2

Name Nathan Reitinger (nr2645); Brett Landau (bl2719)
Class: COMS 4156 
Assignment: Bug Hunt 2

style checker (pylint)

suggested to change name "app_name" and "urlpatterns" in urls.py to uppercase

file

screen shot 2018-11-19 at 9 56 42 pm

missing required field (django)

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)

Unused imports

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)

coms 4156 bug hunt 2

Name: Nathan Reitinger (nr2645); Brett Landau (bl2719)
Class: COMS 4156 
Assignment: Bug Hunt 2

issue

not a true bug, but readme says to cd lrn-deep when the folder is named lrndeep

Lines too long

(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.

unused-import

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

no-else-return

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

missing semicolon

coms 4156 bug hunt 2

Name: Nathan Reitinger (nr2645); Brett Landau (bl2719)
Class:  COMS 4156 
Assignment: Bug Hunt 2

issue

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

file

screen shot 2018-11-19 at 9 30 29 pm

Missing set-up step

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?

Error: no-name-in-module

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

Django issue

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)

Unnecessary else after return

{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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.