Showing 254 of 254 total issues
Similar blocks of code found in 3 locations. Consider refactoring. Open
nick: fields.string({
required: true,
label: 'Nickname',
errorAfterField: true,
widget: widgets.text({
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 68.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
name: fields.string({
required: true,
label: 'Your name',
errorAfterField: true,
widget: widgets.text({
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 68.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
email: fields.string({
required: true,
label: 'Email address',
errorAfterField: true,
widget: widgets.text({
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 68.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function setters
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
static get setters() {
return {
name: function name(realName) {
if (!realName || realName.length < 6) {
return { valid: false, error: 'Please enter at least 6 characters.' };
Similar blocks of code found in 2 locations. Consider refactoring. Open
get sortedLogMessages(): Array<MessageModel> {
return Array.from(this.logMessages.values()).sort((a, b) => a.timestamp - b.timestamp);
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
get sortedMessages(): Array<MessageModel> {
return Array.from(this.messages.values()).sort((a, b) => a.timestamp - b.timestamp);
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 67.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function _markWindow
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
_markWindow(masWindow, x, y, cursor) {
masWindow.cursor = 'none';
const rowCount = this.dimensions.length;
const columnCount = this.dimensions[y].length;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function parseIrcMessage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async function parseIrcMessage({ userId, line, network }) {
const parts = line.trim().split(' ');
const msg = {
params: [],
numericReply: false,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function Profile
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const Profile: FunctionComponent = () => {
const toast = useToast();
const { profileStore, userStore } = useContext(ServerContext);
const [name, setName] = useState<string>('');
const [email, setEmail] = useState<string>('');
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function handleUpdate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async function handleUpdate({ user, command, window, session }) {
const accepted = ['row', 'column', 'minimizedNamesList', 'desktop'];
const acceptedAlerts = ['email', 'notification', 'sound', 'title'];
if (!window) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function handlePrivmsg
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async function handlePrivmsg(user, msg, command) {
// :ilkkao!~ilkkao@127.0.0.1 NOTICE buppe :foo
const target = msg.params[0];
const currentNick = await nicksService.getNick(user.gId, msg.network);
let conversation;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function log
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
log({ level, message, ...meta }, callback) {
const [, processName, processExtension] = process.title.split('-');
let processColumn;
let cat;
Function init
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(args) {
this._super(args);
const message = this.message;
Function exports
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
sourcemaps: {
enabled: true
},
Function Search
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Search: FunctionComponent = () => {
const navigate = useNavigate();
const toast = useToast();
const { windowStore } = useContext(ServerContext);
const [name, setName] = useState<string>('');
Function Search
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Search: FunctionComponent = () => {
const navigate = useNavigate();
const toast = useToast();
const { windowStore } = useContext(ServerContext);
const [name, setName] = useState<string>('');
Function _drawCursor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawCursor(cursor) {
if (cursor.x === null) {
$('#window-cursor').hide();
return;
}
Function createExt
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.createExt = async function createExt(ctx) {
const form = await decodeForm(ctx.req, registrationFormExt);
async function renderForm() {
await ctx.render('register-ext', {
Function constructor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor({ gid, body, doc, category, timestamp, updatedTimestamp, user, window, status }: MessageModelProps) {
this.gid = gid;
this.body = body || '';
this.doc = doc;
this.category = category;
Function handleSendText
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleSendText({ window = mandatory(), text = mandatory() }) {
let sent = false;
setTimeout(() => {
if (!sent) {