Showing 91 of 91 total issues
Function checkRemoteServicesAvailability
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.checkRemoteServicesAvailability = function(services, discoveryOptions) {
var minInterval = 3000
var remoteServices = []
Object.keys(services).forEach(function(serviceName) {
Function getProxyHandler
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.getProxyHandler = function(scheduler, httpServer, upgradeUrl) {
var proxy = httpProxy.createProxyServer({})
if (httpServer && upgradeUrl) {
var re = new RegExp('^' + upgradeUrl)
Similar blocks of code found in 2 locations. Consider refactoring. Open
secondChannel.sub('server:message', function(msg) {
msg = '<b>/channel/b: </b>' + new Date() + ' message from server: <br />' + msg
var el = document.getElementById('message')
el.innerHTML += msg + '<br /><br />'
})
- 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 70.
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
firstChannel.sub('server:message', function(msg) {
msg = '<b>/channel/a: </b>' + new Date() + ' message from server: <br />' + msg
var el = document.getElementById('message')
el.innerHTML += msg + '<br /><br />'
})
- 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 70.
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 startBalancer
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.startBalancer = function(micromono, app, callback) {
var packagePath = ServerPipe.getCallerPath()
logger.info('Start balancer pipeline').debug({
packagePath: packagePath
})
Function startService
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.startService = function(micromono, Service, callback, cbDependencies) {
logger.info('Start service pipeline')
// Get instance of service.
var service = 'function' === typeof Service ? new Service() : Service
// Prepare global service dependencies
Function prepareBundleInfo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
exports.prepareBundleInfo = function(assetInfo, publicPath, bundleOptions) {
// Prepare bundleOptions for jspm/systemjs builder
bundleOptions.name = assetInfo.name
bundleOptions = getDefaultBundleOptions(bundleOptions)
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
"npm:socket.io-client@1.4.8": {
"backo2": "npm:backo2@1.0.2",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"component-bind": "npm:component-bind@1.0.0",
"component-emitter": "npm:component-emitter@1.2.0",
- 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 66.
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
"npm:socket.io-client@1.4.5": {
"backo2": "npm:backo2@1.0.2",
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"component-bind": "npm:component-bind@1.0.0",
"component-emitter": "npm:component-emitter@1.2.0",
- 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 66.
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 ensureChannelGateway
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.ensureChannelGateway = function(services, set) {
logger.debug('ensureChannelGateway')
var chnGateway
var hasServiceWithChannel = Object.keys(services).some(function(name) {
Function getCommonBundles
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.getCommonBundles = function(assetInfo, servicesWithAsset, assetDependenciesMap) {
var numServices = servicesWithAsset.length
// Any dependency required by 70% or more of the services
// Minus any dependencies in assetInfo.micromono.bundleDeps
// (which will be bundled with the main bundle.)
Function bundle
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.bundle = function(assetInfo, packagePath, jspmBinPath, bundleCmd, bundleOptions, set) {
var publicURL = assetInfo.publicURL[0]
jspm.runJSPM(packagePath, jspmBinPath, bundleCmd.split(' '), function(err) {
if (err)
return set('error', err)
Function generateAnnouncement
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.generateAnnouncement = function(service, serviceInfo, host, web, api, channel) {
var ann = new Announcement(service)
ann.host = host
if (web.asset)
ann.asset = web.asset
Function prepareBundleInfo
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.prepareBundleInfo = function(assetInfo, publicPath, bundleOptions) {
// Prepare bundleOptions for jspm/systemjs builder
bundleOptions.name = assetInfo.name
bundleOptions = getDefaultBundleOptions(bundleOptions)
Function normalizeRoutes
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.normalizeRoutes = function(route, page, pageApiBaseUrl) {
var _routes = {}
Object.keys(route).forEach(function(routePath) {
var middleware
Function getDefaultBundleOptions
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getDefaultBundleOptions(opts, env) {
opts = opts || {}
var _opts = {
bundleDeps: false,
outFile: 'bundle' + (opts.name ? '-' + opts.name : '') + '.js',
Similar blocks of code found in 4 locations. Consider refactoring. Open
"npm:engine.io-client@1.6.8": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"component-emitter": "npm:component-emitter@1.1.2",
"component-inherit": "npm:component-inherit@0.0.3",
"debug": "npm:debug@2.2.0",
- 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 61.
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 4 locations. Consider refactoring. Open
"npm:engine.io-client@1.6.11": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"component-emitter": "npm:component-emitter@1.1.2",
"component-inherit": "npm:component-inherit@0.0.3",
"debug": "npm:debug@2.2.0",
- 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 61.
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 4 locations. Consider refactoring. Open
"npm:clean-css@3.1.9": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"commander": "npm:commander@2.6.0",
"fs": "github:jspm/nodelibs-fs@0.1.2",
"http": "github:jspm/nodelibs-http@1.7.1",
- 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 61.
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 4 locations. Consider refactoring. Open
"npm:engine.io-client@1.6.11": {
"buffer": "github:jspm/nodelibs-buffer@0.1.0",
"component-emitter": "npm:component-emitter@1.1.2",
"component-inherit": "npm:component-inherit@0.0.3",
"debug": "npm:debug@2.2.0",
- 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 61.
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