Giter VIP home page Giter VIP logo

tictactoe-gc's Introduction

TicTacToe-GC

a replica of the famous game "XO" written in python for
CLI (command line interface) 

© 2019-2022 Nurul-GC
ArtesGC

tictactoe-gc's People

Contributors

nurul-gc avatar

Stargazers

 avatar  avatar

Watchers

 avatar

tictactoe-gc's Issues

Fix 'Using the global statement' issue in source.py\ticTacToe_GC.py

CodeFactor found an issue: Using the global statement

It's currently on:
source.py\ticTacToe_GC.py:115

Global variables reduce code readability and often cause bugs. Avoid global variable as much as possible.

Example of incorrect code:

WIDTH = 0 # global variable
def area(w):
    global WIDTH # global statement
    WIDTH = w
    return WIDTH * WIDTH

One common solution for this is to create a class and to encapsulate global variables as members of an instantiated object of that class:

class Square:
    def __init__(self, width):
        self.width = width
    def area(self):
        return self.width * self.width

Fix 'Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell' issue in source.py\ticTacToe_GC.py

CodeFactor found an issue: Starting a process with a shell: Seems safe, but may be changed in the future, consider rewriting without shell

It's currently on:
source.py\ticTacToe_GC.py:128

Example of insecure code:

import os
os.system('/bin/echo suspicious code') \
The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function.

Example of secure code:

import subprocess
subprocess.call('/bin/echo suspicious code', shell=False) \

Fix 'Using the global statement' issue in source.py\ticTacToe_GC.py

CodeFactor found an issue: Using the global statement

It's currently on:
source.py\ticTacToe_GC.py:47

Global variables reduce code readability and often cause bugs. Avoid global variable as much as possible.

Example of incorrect code:

WIDTH = 0 # global variable
def area(w):
    global WIDTH # global statement
    WIDTH = w
    return WIDTH * WIDTH

One common solution for this is to create a class and to encapsulate global variables as members of an instantiated object of that class:

class Square:
    def __init__(self, width):
        self.width = width
    def area(self):
        return self.width * self.width

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.