Showing 14 of 14 total issues
Function exports
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function ($q, ConvexRequest, ConvexCache, ConvexBatch, ConvexRelation, ConvexCollection) {
function ConvexModel (attributes) {
attributes = attributes || {};
if (!attributes.id) {
Function exports
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function ($q, ConvexRequest, ConvexCache, ConvexBatch, ConvexRelation, ConvexCollection) {
function ConvexModel (attributes) {
attributes = attributes || {};
if (!attributes.id) {
- 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 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function ($http, $q, $timeout, ConvexCache, convexConfig) {
function ConvexRequest (config) {
this.config = parseConfig(config);
this.deferred = $q.defer();
Function exports
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function ($http, $q, $timeout, ConvexCache, convexConfig) {
function ConvexRequest (config) {
this.config = parseConfig(config);
this.deferred = $q.defer();
- 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 () {
function ConvexCollection (Model, models) {
this.$$model = Model;
this.$$models = [];
Function exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function ($injector, ConvexCollection) {
function ConvexRelation (config) {
this.type = config.type;
this.key = config.key;
- 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 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (ConvexRequest, $q, convexConfig) {
function ConvexBatch () {
this.requests = [];
}
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function ($injector, ConvexCollection) {
function ConvexRelation (config) {
this.type = config.type;
this.key = config.key;
Function exports
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function ($cacheFactory, $window) {
var prefix = 'convex-';
var localStorage = $window.localStorage || {
setItem: angular.noop,
Function $set
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
ConvexModel.prototype.$set = function (attributes) {
var model = this;
Object.keys(attributes)
.filter(function (key) {
if (isForeignKey(key) || !hasRelation(model, key)) {
Function exports
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function () {
function ConvexCollection (Model, models) {
this.$$model = Model;
this.$$models = [];
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function ($q, ConvexRequest, ConvexCache, ConvexBatch, ConvexRelation, ConvexCollection) {
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function ($http, $q, $timeout, ConvexCache, convexConfig) {
Function exports
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function ($cacheFactory, $window) {
var prefix = 'convex-';
var localStorage = $window.localStorage || {
setItem: angular.noop,
- 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"