Showing 38 of 66 total issues
Function script
has 252 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function script (manager: CallbackManager) {
// First register legacy calls.
legacy(manager);
manager.register({
Function script
has 232 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function script (manager: CallbackManager) {
legacy(manager);
manager.register({
callback: 'LibXmlRpc_Rankings',
Function legacy
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function legacy (manager: CallbackManager) {
/**
* PLAYER EVENTS
*/
File ManiaPlanetCallbacks.ts
has 429 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* ManiaPlanet Generic Callbacks
*
* Maps generic mp callbacks into events.
*/
Function script
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function script (manager: CallbackManager) {
legacy(manager);
// Common Trackmania
Function loadPlugins
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public async loadPlugins() {
// Register for Mode Changes and Script Changes
this.app.server.on('mode.change', (transition) => { this.onGameChange('mode', transition); });
this.app.log.debug('Loading plugins from configuration...');
- 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 parse
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public parse () {
this.width = 210;
this.totalWidth = 0;
this.page = 0; // Current Page NR.
Function loadPluginModels
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private async loadPluginModels (plugin: any, id: string, sequelize: Sequelize) {
if (plugin.directory) {
var modelDirectory = path.normalize(plugin.directory + '/models/');
var exists = await fs.exists(modelDirectory);
if (! exists) {
- 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 sendInterface
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public async sendInterface (ui: Interface, force: boolean, updateLogins: string[]) {
var data = {}; // Holds all global data.
var players = []; // Holds login.
var send = '';
- 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
File ListView.ts
has 263 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* List View
*/
import {EventEmitter} from 'events';
Function sendInterface
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async sendInterface (ui: Interface, force: boolean, updateLogins: string[]) {
var data = {}; // Holds all global data.
var players = []; // Holds login.
var send = '';
Function _createAlert
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createAlert(type, title, message, players, size, buttonText, iconstyle, iconsubstyle) {
if (typeof players === 'string') {
players = [players];
}
buttonText.yes = buttonText.yes || 'Yes';
Function constructor
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (facade: Database.Facade) {
this.app = facade.app;
let config = facade.config.config.config.db;
this.sequelize = null;
Function connect
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public async connect(login: string, nickname: string, info?: PlayerInfo | boolean | any,
emit?: boolean): Promise<Player> {
info = info || {};
emit = emit || 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 register
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public register(options: CallbackOptions) {
let callbackName = options.callback;
let eventName = options.event;
let parameters = options.parameters || {};
Function loadPlugins
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async loadPlugins() {
// Register for Mode Changes and Script Changes
this.app.server.on('mode.change', (transition) => { this.onGameChange('mode', transition); });
this.app.log.debug('Loading plugins from configuration...');
Function pluginChecks
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private async pluginChecks () {
let currentMode = this.app.serverFacade.client.currentMode();
// Check if we need to disable plugins.
for (let pluginId of Object.keys(this.plugins)) {
- 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 connect
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async connect(login: string, nickname: string, info?: PlayerInfo | boolean | any,
emit?: boolean): Promise<Player> {
info = info || {};
emit = emit || false;
Function default
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function (sequelize: Sequelize, DataTypes: DataTypes) {
return sequelize.define('Setting', {
context: {
type: DataTypes.STRING,
allowNull: false
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
require('load-grunt-config')(grunt, {
jitGrunt: {}
});
require('time-grunt')(grunt);