Showing 111 of 111 total issues
Function navigation
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function navigation() {
var $mainNavContainer = $('#main-navigation-container');
var lang = $('html').attr('lang') || 'en-US';
var $expandedNavTriggers = $('.navbar-toggle');
Function resultsCallback
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function resultsCallback(err, data, total) {
var isStickySearch = (searchOptions.tagPrefix === options.stickyPrefix),
itemString = '',
frag = document.createElement('div'),
makerID = $('meta[name=\'maker-id\']').attr('content'),
Function addCSP
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.addCSP = function (options) {
return hood.csp({
headers: [
'Content-Security-Policy-Report-Only'
],
Function getSvgPlacement
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getSvgPlacement(element, placement) {
var svgElement = element.closest('svg')[0],
domElement = element[0],
point = svgElement.createSVGPoint(),
boundingBox = domElement.getBBox(),
Function powerTip
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.fn.powerTip = function(opts, arg) {
// don't do any work if there were no matched elements
if (!this.length) {
return this;
}
Function permissionsModel
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
var permissionsModel = function (options) {
var permissions = {
'webmaker-super-mentor': {
'issue': 3,
'applications': 3,
Similar blocks of code found in 4 locations. Consider refactoring. Open
emitter.on('application-on', function () {
$issueBadgeOn.addClass('hidden');
$claimCodContainer.addClass('hidden');
$applicationOn.removeClass('hidden');
$applicationOff.addClass('hidden');
- 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 72.
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
emitter.on('js-issue-badge-on', function () {
$applicationOn.addClass('hidden');
$claimCodContainer.addClass('hidden');
$issueBadgeOn.removeClass('hidden');
$applicationOff.addClass('hidden');
- 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 72.
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
emitter.on('claim-code-button-click', function () {
$applicationOn.addClass('hidden');
$issueBadgeOn.addClass('hidden');
$claimCodContainer.removeClass('hidden');
$applicationOff.removeClass('hidden');
- 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 72.
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
emitter.on('application-off', function () {
$applicationOn.addClass('hidden');
$issueBadgeOn.addClass('hidden');
$claimCodContainer.addClass('hidden');
$applicationOff.removeClass('hidden');
- 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 72.
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 link
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function ($scope, $element, $attrs) {
var options = [];
var lang;
for (var i = 0; i < config.supported_languages.length; i++) {
lang = config.supported_languages[i];
Function pagination
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
UI.pagination = function (page, total, limit, callback) {
var $pagination = $('.pagination'),
$ul = $pagination.find('ul'),
$li = $('<li></li>'),
$pageBtn,
Similar blocks of code found in 2 locations. Consider refactoring. Open
$http
.get('/data/madewithcode.json')
.success(function (data) {
$rootScope.madewithcode = data;
$rootScope.mwcReady = true;
- 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 71.
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
$http
.get('/data/content.json')
.success(function (data) {
$rootScope.allContent = data;
$rootScope.contentReady = true;
- 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 71.
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 select
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
UI.select = function (select, fn) {
$('.filter').removeClass('hide');
var $el = $('.ui-select', $fragments).clone(true),
$toggleBtn = $el.find('.icon'),
Function onboardingExperience
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function onboardingExperience() {
$('#home-start-form').on('submit', function () {
$rootScope.joinWebmaker($('.home-email-field').val(), '', $('#onboarding-checkbox').prop('checked'));
});
var input = $('.onboarding-input');
Function getHtmlPlacement
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getHtmlPlacement(element, placement) {
var objectOffset = element.offset(),
objectWidth = element.outerWidth(),
objectHeight = element.outerHeight(),
left,
Function SocialMedia
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
return function SocialMedia( options ) {
var urlPlaceHolder = options.url || "__URL__PLACE__HOLDER__";
/**
* The various social media all have the same API.
Function process
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
makeClient.process = function (callback, id) {
makeClient.then(function (err, data, totalHits) {
if (err) {
return callback(err);
}
Function exports
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (req, res) {
var make = require('../lib/makeapi').readOnly,
querystring = require('querystring');
var DEFAULT_TYPE = 'tags',
- 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"