This repository has been archived by the owner on Jul 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
/
points.yaml
106 lines (93 loc) · 3.5 KB
/
points.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Points configuration for Expression Language component evaluation
points:
# Points for opening each topic
topic: 1
# Points for comment
comment: 1
# Points for reply
reply: 1
# Additional points for length of comment or reply.
message_length: 'floor(strlen(message)/50)'
# Points for reactions on topic
topic_reactions: '(topic.getReactionsCount() >= 100) ? 15 : ceil(topic.getReactionsCount() / 10)'
# Points for number of reactions on comment or reply
comment_reactions: '(comment.getReactionsCount() > 100) ? 15 : ceil(comment.getReactionsCount() / 10)'
# Points for topics with only image or animated image (such as bumped images from
# album topics and images without much description).
image: '(strlen(topic.getMessage()) <= 5 && topic.getType() in ["photo", "animated_image_share"]) ? 0 : points'
# Points for topics with comments turned off.
closed_topic: '!topic.getCanComment() ? 0 : points'
# Array of recommended and not recommended links which affect the points
# calculation. [url, points]
urls:
- ['github.com', 10]
- ['github.io', 10]
- ['php.net', 20]
- ['php.earth', 20]
- ['wwphp-fb.github.io', 20]
- ['packagist.org', 10]
- ['getcomposer.org', 10]
- ['phptherightway.com', 10]
- ['sitepoint.com', 10]
- ['phpclasses.org', 10]
- ['stackoverflow.com', 10]
- ['phpunit.de', 10]
- ['php-fig.org', 10]
- ['developer.mozilla.org', 10]
- ['pastebin.com', 10]
- ['codepad.org', 10]
- ['codepen.io', 10]
- ['codejaw.com', 10]
- ['jsfiddle.net', 10]
- ['nopaste.me', 10]
- ['paste.ee', 10]
- ['phptester.net', 10]
- ['regex101.com', 10]
- ['sqlfiddle.com', 10]
- ['pasted.co', 10]
- ['hastebin.com', 10]
- ['pastefs.com', 10]
- ['paste.ubuntu.com', 10]
- ['phpliveregex.com', 10]
- ['3v4l.org', 10]
- ['eval.in', 10]
- ['code.runnable.com', 10]
- ['phpfiddle.org', 10]
- ['w3schools.com', -10]
- ['lmgtfy.com', -10]
- ['phpthewrongway.com', -15]
# Points for topics from admins
admin_topic: '(topic.getUser().getId() in admins) ? 5 : 0'
# Posting source code on Facebook is not readable. Using Gist and similar
# no-paste services are recommended. Topics with code get don't get points.
code: '(codeDetector.isCode(message)) ? 0 : points'
# Minimum lines of code for message to be detected as code
min_code_lines: 4
# Regular expressions for detecting lines with code
code_regex:
# PHP code opening tag
- '/\<\?(php)?/'
# variable assignment
- '/\$\w.*\=.*(\;|array|\[)/'
# statement
- '/(if|for|foreach|while|switch)\s*\(.*\)/'
# return statement
- '/^return(\s+.*)?;/'
# function call
- '/\w\S*\s*\(.*\)\s*;/'
# html tag
- '/\<\w+\>(.*<\/\w+>)/'
# class field
- '/(public|protected|private)\s+(static\s+)?\$\w.*;/'
# class method
- '/(public|protected|private)\s+(abstract|static\s+)?function\s*\(/'
# curly brace
- '/{|}/'
# class, interface
- '/(abstract\s+)?(class|interface)\s+\w+/'
# use statement
- '/^use\s+(\S+);/'
# PHP functions
- '/(include_once|require_once|echo)/'
# array elements
- '/(\"|\'')\w+(\"|\'')\s?\=\>\s?\w+(\,|\)|\])?$/'