Showing 84 of 177 total issues
Function serialize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function serialize(data, prefix) {
let str = [],
p;
for (p in data) {
if (Object.prototype.hasOwnProperty.call(data, p)) {
- 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 show
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function show(ShowProjectRequest $request): JsonResponse
{
Filter::listen(Filter::getSuccessResponseFilterName(), static function ($project) {
$totalTracked = 0;
$taskIDs = array_map(static function ($task) {
Method create
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function create(CreateTimeIntervalRequest $request): JsonResponse
{
Filter::listen(
Filter::getRequestFilterName(),
static function (array $requestData) {
Method postForm
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function postForm(Request $request, string $key): JsonResponse
{
$invitation = Invitation::where('key', $key)
->where('expires_at', '>=', time())
->first();
Method up
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
DB::unprepared("
CREATE OR REPLACE ALGORITHM=MERGE VIEW `project_report` AS
SELECT
Method up
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('full_name');
Function timePerProject
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
timePerProject: (state, getters) => {
return Object.keys(getters.intervals).reduce((result, userID) => {
const userEvents = getters.intervals[userID];
if (!userEvents) {
return result;
- 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 setLoading
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const setLoading = value => {
if (value) {
if (pendingRequests === 0) Vue.prototype.$Loading.start();
pendingRequests++;
} else {
- 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 render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: (h, data) => {
if (!hasRole(router.app.$store.getters['user/user'], 'admin')) {
return h(
'ul',
{},
Method solve
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function solve(string $captchaToken = ''): void
{
if (!$this->captchaEnabled()) {
return;
}
Method login
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function login(LoginRequest $request): JsonResponse
{
$credentials = $request->only(['email', 'password', 'recaptcha']);
$this->recaptcha->check($credentials);
Method handle
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(): int
{
if (!$this->option('force') && !$this->confirm('Are you sure want to drop data for your Cattr instance?')) {
return 0;
}
Method _rules
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _rules(): array
{
return [
'id' => 'required|int',
'full_name' => 'sometimes|required|string',
Function createStatusDialog
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createStatusDialog(type) {
const statusTitles = {
info: '信息',
success: '成功',
warning: '警告',
Method hasProjectRole
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
final public function hasProjectRole(Role|array $role, int $projectId): bool
{
$self = $this;
$roles = Cache::store('octane')->remember(
"role_project_$self->id",
Function defultCallback
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const defultCallback = action => {
if (currentModal) {
const callback = currentModal.callback;
if (typeof callback === 'function') {
if (instance.showInput) {
Function showNextModal
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const showNextModal = () => {
initInstance();
instance.action = '';
if (!instance.visible && modalQueue.length) {
- 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 ru
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
ru: function (choice, choicesLength) {
// this === VueI18n instance, so the locale property also exists here
if (choice === 0) {
return 0;
- 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 hasProjectRole
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
final public function hasProjectRole(Role|array $role, int $projectId): bool
{
$self = $this;
$roles = Cache::store('octane')->remember(
"role_project_$self->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 thin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function thin($force = false): void
{
if ((!$force && !self::needThinning()) || Cache::store('octane')->get('thinning_now')) {
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"