Skip to content

Instantly share code, notes, and snippets.

View isatimur's full-sized avatar
⛰️
Remotely

Timur Isachenko isatimur

⛰️
Remotely
View GitHub Profile
@isatimur
isatimur / clean_code.md
Created April 10, 2021 08:36 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

[
{
"microservice": {
"id": 238,
"name": "courses",
"code":"school-courses",
"entities": [
{
"id": 208,
"name": "courses"
@isatimur
isatimur / app.js
Created July 7, 2020 09:30
Node js example of how fetch FNS open information
var http = require('http');
var express = require('express');
var app = express();
const fetch = require('node-fetch');
app.get('/:inn', function (req, res) {
const {inn} = req.params;
const response = fetch("https://egrul.nalog.ru/", {
{
"page": 0,
"size": 1,
"totalSize": 203,
"entities": [
{
"id": 0123,
"slug": "registraciya-kredita",
"title": "Регистрация кредита",
"shortDescription": "Курс состоит из пошаговых инструкций, которые помогут предпринимателю.",
curl -X HEAD \
https://cdn.dasreda.ru/storage-data/039049c5-6500-460e-aea7-d1452408e2b2/kak_ne_ubit-_biznes_kassovym_razryvom.pdf \
-H 'authorization: Bearer fuck.yourself.true-token' \
-H 'cache-control: no-cache' \
-H 'content-type: application/json' \
-H 'postman-token: fdd83e1c-2d15-8312-0869-316d92eca807' \
-H 'source: ui' \
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Page<T> {
private int page;
private int size;
private int totalSize;
private List<T> entities;
}
class Cash {
private final Exchange exchange;
private final int cents;
public Cash(Exchange exch, int cents) {
this.exchange = exch;
this.cents = cents;
}
public Cash in(String currency) {
return new Cash(
this.exchange,
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<module name="SuppressWarningsFilter" />
<module name="TreeWalker">
<property name="tabWidth" value="4"/>
Вопросы по дизайн ревью и код ревью:
- это разделение по пакетам и модульность - а также применение паттернов проектирования - пример Lagom
- тестирование должно соблюдаться с неким порогом покрытия тестов, правильным наименованием теста - сигнатура теста, разделением тестов на интеграционный, unit и функциональный тесты.
- обследование инструментария тестирования для play framework-а - jacoco, selenium, junit4, sonar, checkstyle - очень важный момент это с тестирование Actor-ов
чек стайл - нужно выбрать:
https://stackoverflow.com/questions/16929442/how-to-integrate-checkstyle-and-pmd-into-play-framework-build-scala-file
http://ics-software-engineering.github.io/play-example-quality-assurance/
https://www.quora.com/How-do-I-implement-check-style-set-up-for-play-framework-with-Java
https://blog.thomastoye.be/play-framework-ci-507b9e77d5b3
https://groups.google.com/forum/#!topic/play-framework/1aGhAMmIZyU