Showing 196 of 196 total issues
Function fetch_theme_info_by_name
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
theme_manager.prototype.fetch_theme_info_by_name = function (theme_name, options) {
const self = this
// list all themes and exit if specified theme is not found
if (!theme_name) {
Function call
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
api_call.prototype.call = function (req, res, enduro_server) {
let jsonString = ''
req.on('data', function (data) {
jsonString += data
Function call
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
api_call.prototype.call = function (req, res, enduro_server) {
let jsonString = ''
req.on('data', function (data) {
jsonString += data
Function build
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function build (pagepath, partial_pages, fullpath) {
// decides if pagepath is folder or file
if (pagepath.length == 1) {
Function culturize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function culturize (context, culture) {
if (typeof (context) != 'object') {
return context
}
- 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 request_file
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
remote_handler.prototype.request_file = function (url) {
return new Promise(function (resolve, reject) {
if (flat_helpers.is_local(url)) {
fs.readFile(url, 'utf8', function (err, data) {
if (err) {
- 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 call
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
api_call.prototype.call = function (req, res, enduro_server) {
// gets query parameters
const sid = req.query.sid
const globalizer_string = req.query.globalizer_string
Function abstract_diff_item
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function abstract_diff_item (item) {
item.filename = item.name1 || item.name2
item.name = item.filename
item.type = item.type1 || item.type2
Function call
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
api_call.prototype.call = function (req, res, enduro_server) {
const sid = req.query.sid
enduro.flags.temporary_nostaticwatch = true
Function get_user_by_username
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
admin_security.prototype.get_user_by_username = function (username) {
return new Promise(function (resolve, reject) {
// load up all admins
return flat.load(enduro.config.admin_secure_file)
.then((raw_userlist) => {
- 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 upload_by_url
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
file_uploader.prototype.upload_by_url = function (file_url) {
const self = this
return new Promise(function (resolve, reject) {
const filename = flat_helpers.get_filename_from_url(file_url)
Function upload
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
filesystem.prototype.upload = function (filename, path_to_file) {
const self = this
return new Promise(function (resolve, reject) {
Similar blocks of code found in 4 locations. Consider refactoring. Open
return gulp.src(enduro.project_path + '/assets/css/*.scss')
.pipe(bulkSass())
.pipe(sourcemaps.init())
.pipe(sass())
.on('error', function (err) {
- 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 56.
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
return gulp.src(enduro.project_path + '/assets/css/*.styl')
.pipe(sourcemaps.init())
.pipe(stylus({
use: [ autoprefixer('last 5 versions') ]
}))
- 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 56.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!sid || !filename || !content) {
res.send({success: false, message: 'Parameters not provided'})
return logger.err('parameters not provided')
}
- 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 56.
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
return gulp.src(enduro.project_path + '/assets/css/*.less')
.pipe(sourcemaps.init())
.pipe(less({
paths: enduro.config.less && enduro.config.less.paths || [],
plugins: [ autoprefixer ]
- 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 56.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (!sid || !filename || !content) {
res.send({success: false, message: 'Parameters not provided'})
return logger.err('parameters not provided')
}
- 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 56.
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
return gulp.src([enduro.project_path + '/assets/js/*.js',
'!' + enduro.project_path + '/assets/js/*.min.js',
'!' + enduro.project_path + '/assets/js/handlebars.js'])
.pipe(sourcemaps.init())
.pipe(gulpif(enduro.config.babel, babel(babelConfig)))
- 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 56.
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 call
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
api_call.prototype.call = function (req, res, enduro_server) {
// gets query parameters
const sid = req.query.sid
const filename = req.query.filename
Function render_file_by_context
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
page_renderer.prototype.render_file_by_context = function (template_path, context, culture) {
// extracts the relative path to the template from the absolute path
const file_regex_match = template_path.match(/pages(?:\/|\\)(.*)\.([^\\/]+)$/)
const filename = file_regex_match[1]