Git Product home page Git Product logo

reader's Introduction

reader's People

Contributors

gapiyka avatar

Watchers

 avatar

reader's Issues

Code review

  1. I'd prefer to use collections instead of if-statements in casas like this:
    if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.Escape))
    Dialog.PreviousTab();
    if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.Return))
    Dialog.NextTab();
    if (Input.GetKeyDown(KeyCode.DownArrow) || MouseWheelAxis < 0)
    Dialog.NextItem();
    if (Input.GetKeyDown(KeyCode.UpArrow) || MouseWheelAxis > 0)
    Dialog.PreviousItem();
    if (Input.GetMouseButtonDown(0))
  2. Id you use code block {} in else it is better to use it in positive if-branch too:
    if (FormatFilter(text))
    OpenFile();
    else
    {
  3. Magic numbers anpipattern is not about only numbers, for example if you have hardcoded color or string in source without constant or any understandable nam
    ing/identifying its also an issue to refactor
  4. Long procedures like this should be decomposed
    public static List<string> TextToBook(string text)
    {
    string newPage = "";
    int lineCounter = 0;
    int charCounter = 0;
    int pagesCount = 1;
    List<string> pages = new();
    text = text.Replace("\r", "");
    for (int c = 0; c < text.Length; c++)
    {
    charCounter++;
    if (charCounter == lineSize)
    {
    if (!(text[c - 1] == ' ' || text[c - 1] == '\n' || text[c - 1] == '\t'))
    newPage += "-";
    newPage += "\n";
    charCounter = 0;
    lineCounter++;
    }
    if (text[c] == '\n')
    {
    if (newPage.Length > 1)
    if (text[c - 1] == '\n' && text[c - 2] == '\n')
    {
    newPage.Remove(newPage.Length - 1);
    continue;
    }
    charCounter = 0;
    lineCounter++;
    }
    newPage += text[c];
    if (lineCounter == pageSize * pagesCount)
    {
    pages.Add(newPage);
    pagesCount++;
    newPage = "";
    }
    }
    if (newPage != "") pages.Add(newPage);
    return pages;
    }
  5. Duplicate expressions, I'd prefer to put to intermediate variable:
    if (!(text[c - 1] == ' ' || text[c - 1] == '\n' || text[c - 1] == '\t'))
  6. Project have a small and not complex codebase

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.