Showing 32 of 82 total issues
File app.js
has 578 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
// TODO(mkhatib): Seperate these into config/routes.js and
// config/interceptors/httpInterceptors.js and add tests for them.
// TODO(mkhatib): Move the autogenerated appConfig.js to config/constants.js.
Function link
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element, attrs, ngModel) {
ngModel.$render = function() {
if (ngModel.$viewValue) {
editor.loadJSON(JSON.parse(ngModel.$viewValue));
editor.render();
File config.js
has 333 lines of code (exceeds 250 allowed). Consider refactoring. Open
var src = 'app';
var development = 'build/development';
var production = 'build/production';
var dist = 'dist';
Function link
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element) {
var mainCommentBox = element.find('div')[0];
var textarea = element.find('textarea')[0];
$rootScope.$watch('user', function() {
Function link
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element) {
var page = 1;
scope.hasNext = true;
scope.inProgress = false;
Function link
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element) {
$rootScope.pushAside = false;
scope.menuStatus = 'closed';
scope.logout = function () {
$analytics.eventTrack('Logout', {
Method perform
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform(start_index=1)
if @@client.nil? or @@analytics.nil?
puts 'Not calculating total articles stats due to client authorization or service discovery issue.'
return
TimingFunctions
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
Animation.TimingFunctions = {
linearTween: function(t){
return t;
},
easeInQuad: function(t){
Method perform
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def perform(start_index=1)
if @@client.nil? or @@analytics.nil?
puts 'Not calculating total articles stats due to client authorization or service discovery issue.'
return
- 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 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element) {
scope.selectedCategory = null;
scope.categories = Category.query();
scope.topics = [];
// scope.allowCreateTopics = false;
Function link
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function (scope, element) {
scope.commentsCount = 0;
scope.commentsCountToShow = 4;
// Shows the anchor icon for the user to click.
Function loadMoreData
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
scope.loadMoreData = function() {
scope.inProgress = true;
if(scope.state === 'publishers') {
User.query({
Method index
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def index
# Retreive users around a specific user id.
# TODO(mkhatib): This is really ugly and hacky.
# Move this to the user model and come up with a better way to paginate.
- 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
Method create
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
unless resource_params[:email]
return render json: {
success: false,
errors: ['You must provide an email address.']
Method create
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
# Check
field = (resource_params.keys.map(&:to_sym) & resource_class.authentication_keys).first
@resource = nil
Method index
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
# Retreive users around a specific user id.
# TODO(mkhatib): This is really ugly and hacky.
# Move this to the user model and come up with a better way to paginate.
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
Function save
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
save: function (data, optSuccess, optError, optProgress) {
var delayedObj = {};
// TODO(mkhatib): Until we figure out a way to rename files either
Method up
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.up
#Tables
#Conversations
create_table :mailboxer_conversations do |t|
t.column :subject, :string, :default => ""
Method create
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create
unless resource_params[:email]
return render json: {
success: false,
errors: ['You must provide an email address.']
- 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"