Showing 300 of 562 total issues
Function Param
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.Param = function Param(id, type, config, location) {
var self = this;
config = unwrapShorthand(config);
type = getType(config, type, location);
var arrayMode = getArrayMode();
Function link
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function link($scope, $element, $attr, ctrls) {
var childScope;
var childElement;
var tabsCtrl = ctrls[0];
var tabCtrl = ctrls[1];
Function UrlMatcher
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function UrlMatcher(pattern, config, parentMatcher) {
config = extend({ params: {} }, isObject(config) ? config : {});
// Find all placeholders and create a compiled pattern, using either classic or curly syntax:
// '*' name
Function $get
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function $get( $location, $rootScope, $injector, $browser) {
var baseHref = $browser.baseHref(), location = $location.url(), lastPushedUrl;
function appendBasePath(url, isHtml5, absolute) {
Function controller
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {
var _this = this;
var continuous = $scope.$eval($scope.doesContinue) === true;
var shouldAutoPlay = isDefined($attrs.autoPlay) ? !!$scope.autoPlay : false;
Function LoginWithFacebook
has 94 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func LoginWithFacebook(w http.ResponseWriter, r *http.Request) {
apiUrl := "https://graph.facebook.com"
accessTokenPath := "/v2.3/oauth/access_token"
graphApiPath := "/v2.3/me"
Function transition
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.transition = function(enteringHeaderBar, leavingHeaderBar, viewData) {
var enteringHeaderBarCtrl = enteringHeaderBar.controller();
var transitionFn = $ionicConfig.transitions.navBar[viewData.navBarTransition] || $ionicConfig.transitions.navBar.none;
var transitionId = viewData.transitionId;
Function LoginWithGoogle
has 93 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func LoginWithGoogle(w http.ResponseWriter, r *http.Request) {
accessTokenUrl := "https://accounts.google.com/o/oauth2/token"
peopleApiUrl := "https://www.googleapis.com"
peopleApiPath := "/plus/v1/people/me/openIdConnect"
Function getLoader
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getLoader() {
if (!loaderInstance) {
loaderInstance = $ionicTemplateLoader.compile({
template: LOADING_TPL,
appendTo: $ionicBody.get()
Function init
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function init() {
var listView = listCtrl.listView = new ionic.views.ListView({
el: $element[0],
listEl: $element.children()[0],
scrollEl: scrollCtrl && scrollCtrl.element,
Function doTouchEnd
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
doTouchEnd: function(e, timeStamp) {
if (timeStamp instanceof Date) {
timeStamp = timeStamp.valueOf();
}
if (typeof timeStamp !== "number") {
Function dragGesture
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handler: function dragGesture(ev, inst) {
if (ev.srcEvent.type == 'touchstart' || ev.srcEvent.type == 'touchend') {
this.preventedFirstMove = false;
} else if (!this.preventedFirstMove && ev.srcEvent.type == 'touchmove') {
Method from_auth
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def self.from_auth(params, current_user)
params = params.smash.with_indifferent_access
authorization = Authorization.find_or_initialize_by(provider: params[:provider], uid: params[:uid])
if authorization.persisted?
if current_user
- 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 createPopup
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createPopup(options) {
options = extend({
scope: null,
title: '',
buttons: []
Function $get
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$get: ['$q', function($q) {
var self = {
/**
* @ngdoc method
Function OAuth1
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var OAuth1 = (function () {
function OAuth1($http, $window, SatellizerConfig, SatellizerPopup) {
this.$http = $http;
this.$window = $window;
this.SatellizerConfig = SatellizerConfig;
Function __stepThroughDeceleration
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
__stepThroughDeceleration: function(render) {
var self = this;
//
Function DelegateService
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ionic.DelegateService = function(methodNames) {
if (methodNames.indexOf('$getByHandle') > -1) {
throw new Error("Method '$getByHandle' is implicitly added to each delegate service. Do not list it as a method.");
}
Function OAuth
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var OAuth = (function () {
function OAuth($http, $window, $timeout, $q, SatellizerConfig, SatellizerPopup, SatellizerStorage, SatellizerShared, SatellizerOAuth1, SatellizerOAuth2) {
this.$http = $http;
this.$window = $window;
this.$timeout = $timeout;
Function __repositionScrollbars
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
__repositionScrollbars: function() {
var self = this,
heightScale, widthScale,
widthDiff, heightDiff,
x, y,