Showing 93 of 93 total issues
File angular-animate.js
has 1106 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @license AngularJS v1.3.15
* (c) 2010-2014 Google, Inc. http://angularjs.org
* License: MIT
*/
Function exports
has 258 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (amna) {
amna.mongoId = function (param) {
return ':' + param + '([0-9a-f]{24})';
};
Function exports
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (amna) {
amna.mongoId = function (param) {
return ':' + param + '([0-9a-f]{24})';
};
- 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 performAnimation
has 171 lines of code (exceeds 25 allowed). Consider refactoring. Open
function performAnimation(animationEvent, className, element, parentElement, afterElement, domOperation, options, doneCallback) {
var noopCancel = noop;
var runner = animationRunner(element, animationEvent, className, options);
if (!runner) {
fireDOMOperation();
Function animationRunner
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
function animationRunner(element, animationEvent, className, options) {
//transcluded directives may sometimes fire an animation using only comment nodes
//best to catch this early on to prevent any animation operations from occurring
var node = element[0];
if (!node) {
Function phase_1
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function phase_1(amna, log) {
var AMNACache = amna.thing.mongoose({
key: {
type: String,
Function exports
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (amna) {
var MongooseThing = function MongooseThing(schema) {
schema.deleted = Boolean;
if (amna.createdByThing) {
Function exports
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (amna, log) {
var queryJSON = function (data) {
return '?' + encodeURIComponent(JSON.stringify(data));
};
Function animateRun
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
function animateRun(animationEvent, element, className, activeAnimationComplete, styles) {
var node = extractElementNode(element);
var elementData = element.data(NG_ANIMATE_CSS_DATA_KEY);
if (node.getAttribute('class').indexOf(className) == -1 || !elementData) {
activeAnimationComplete();
Function exports
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (amna, log) {
var queryJSON = function (data) {
return '?' + encodeURIComponent(JSON.stringify(data));
};
- 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 exports
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (amna) {
var MongooseThing = function MongooseThing(schema) {
schema.deleted = Boolean;
if (amna.createdByThing) {
- 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 link
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs) {
// Give each directive instance a new id
iframeID++;
function setLoadingState(state) {
Function exports
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (amna, log) {
var Interaction = function (req, res, next, done) {
this.req = req;
this.res = res;
Function $auth
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
amna.$auth = function (done) {
defaults();
setupAuth();
amna.$passport = passport;
Function exports
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (amna, log) {
return function (config, done) {
/**
* Set settings
Function exports
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (amna, log) {
var Interaction = function (req, res, next, done) {
this.req = req;
this.res = res;
- 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 exports
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (amna, log) {
var app = express();
app.use(bodyParser.urlencoded({ extended: true }));
app.use(bodyParser.json());
app.use(methodOverride('_method'));
Similar blocks of code found in 2 locations. Consider refactoring. Open
doc.save(function (err) {
if (err) {
log('<fail> save key', this.key, err);
return done(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 82.
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 3 locations. Consider refactoring. Open
var setupCollectionPut = function (collection, options) {
/**
* PUT /collection
*/
if (!options.readOnly && options.collectionPut !== false) {
- 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 82.
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 3 locations. Consider refactoring. Open
var setupCollectionDelete = function (collection, options) {
/**
* DELETE /collection
*/
if (!options.readOnly && options.collectionDelete !== false) {
- 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 82.
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