Showing 14 of 122 total issues
Function constructor
has 301 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(args: ConstructorArgsType) {
super();
this.messages = [];
this.host = args.host;
File symphony.js
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright 2017 Jon Freedman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File symphony-test.js
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright 2017 Jon Freedman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
File nock-server.js
has 381 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright 2017 Jon Freedman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Symphony
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class Symphony {
host: string;
keyManagerHost: string;
sessionAuthHost: string;
agentHost: string;
File adapter.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Copyright 2017 Jon Freedman
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Function constructor
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(robot: Robot, options: AdapterOptionsType) {
super(robot);
this.robot = robot;
if (process.env.HUBOT_SYMPHONY_HOST === undefined || process.env.HUBOT_SYMPHONY_HOST === null) {
Function run
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
run() {
this.robot.logger.info('Initialising...');
const getEnv = function(key: string, defaultVal: ?string): string {
const value = process.env[key];
Function _httpRequest
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_httpRequest<T>(method: string, host: string, path: string, headers: HttpHeaderType, body: ?mixed, formData: ?mixed): Promise<T> {
let self = this;
return new Promise((resolve, reject) => {
let options = {
baseUrl: `https://${host}`,
Function constructor
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
super();
// echo any errors
this.on('error', function(err: Error) {
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(args: ConstructorArgsType) {
this.host = args.host;
this.keyManagerHost = args.keyManagerHost || args.host;
this.sessionAuthHost = args.sessionAuthHost || args.host;
this.agentHost = args.agentHost || args.host;
Function send
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
send(envelope: SimpleMessageEnvelopeType, ...messages: Array<MessageTypeOrString>) {
this.robot.logger.debug(`Sending ${messages.length} messages to ${envelope.room}`);
for (const message of messages) {
if (typeof message === 'string') {
let messageML = message;
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor(robot: Robot, options: AdapterOptionsType) {
super(robot);
this.robot = robot;
if (process.env.HUBOT_SYMPHONY_HOST === undefined || process.env.HUBOT_SYMPHONY_HOST === null) {
- 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 constructor
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
constructor() {
super();
// echo any errors
this.on('error', function(err: Error) {
- 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"